Commit 19ae33d8 authored by houlinfeng's avatar houlinfeng

fix: 1. 修复写markdown乱码 2. 更新readme

parent 9cb88954
......@@ -36,7 +36,7 @@ pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# 进入程序目录
cd projects/web_demo/web_demo
# 启动服务
python3 app.py
python3 app.py 或者 python app.py
# 在浏览器访问启动的地址即可访问界面
```
......
......@@ -97,7 +97,7 @@ def analysis_pdf_task(pdf_dir, image_dir, pdf_path, is_ocr, analysis_pdf_id):
full_md_content += item["md_content"] + "\n"
full_md_name = "full.md"
with open(f"{pdf_dir}/{full_md_name}", "w") as file:
with open(f"{pdf_dir}/{full_md_name}", "w", encoding="utf-8") as file:
file.write(full_md_content)
with app.app_context():
full_md_link = url_for('analysis.mdview', filename=full_md_name, as_attachment=False)
......@@ -108,7 +108,7 @@ def analysis_pdf_task(pdf_dir, image_dir, pdf_path, is_ocr, analysis_pdf_id):
for n, md in enumerate(json.loads(md_content)):
md_content = md["md_content"]
md_name = f"{md.get('page_no', n)}.md"
with open(f"{pdf_dir}/{md_name}", "w") as file:
with open(f"{pdf_dir}/{md_name}", "w", encoding="utf-8") as file:
file.write(md_content)
md_url = url_for('analysis.mdview', filename=md_name, as_attachment=False)
md_link_list.append(f"{md_url}&pdf={pdf_name}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment