修复编码问题、允许修改port

This commit is contained in:
xunbu
2025-07-04 19:15:21 +08:00
parent 13abf292a3
commit c3e7e0540f
6 changed files with 38 additions and 27 deletions

View File

@@ -196,7 +196,7 @@ def unembed_base64_images_to_zip(markdown:str,markdown_name:str,image_folder_nam
f.write(base64.b64decode(b64data))
return f"![{match.group(1)}]({url})"
modified_md_content = re.sub(pattern, unembed_base64_images,markdown)
with open(os.path.join(temp_dir,f"{markdown_name}"),"w") as f:
with open(os.path.join(temp_dir,f"{markdown_name}"),"w",encoding="utf-8") as f:
f.write(modified_md_content)
zip_buffer=io.BytesIO()
folder_path=Path(temp_dir)