Skip to content

Commit

Permalink
fix: Title text partially missing issue in recovery_to_markdown.py (#…
Browse files Browse the repository at this point in the history
…14216)

* fix: Title text partially missing issue in `recovery_to_markdown.py`

* fix: Title text partially missing issue in `recovery_to_markdown.py`

* fix the code style for pr
  • Loading branch information
Coobiw authored Nov 27, 2024
1 parent b1b50fc commit b6bcde1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ppstructure/recovery/recovery_to_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ def replace_special_char(content):
f"""<div align="center">\n\t<img src="{img_name+"/"+img_file_name}">\n</div>"""
)
elif region["type"].lower() == "title":
markdown_string.append(f"""# {region["res"][0]["text"]}""")
markdown_string.append(
f"""# {region['res'][0]['text']}"""
+ "".join(
[" " + one_region["text"] for one_region in region["res"][1:]]
)
)
elif region["type"].lower() == "table":
markdown_string.append(region["res"]["html"])
elif region["type"].lower() == "header" or region["type"].lower() == "footer":
Expand Down

0 comments on commit b6bcde1

Please sign in to comment.