From b6bcde143d96cb659e9456320bdcedf6ae01f06b Mon Sep 17 00:00:00 2001 From: Coobiw Date: Wed, 27 Nov 2024 21:41:22 +0800 Subject: [PATCH] fix: Title text partially missing issue in `recovery_to_markdown.py` (#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 --- ppstructure/recovery/recovery_to_markdown.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ppstructure/recovery/recovery_to_markdown.py b/ppstructure/recovery/recovery_to_markdown.py index 833628e134..24727c9fbd 100644 --- a/ppstructure/recovery/recovery_to_markdown.py +++ b/ppstructure/recovery/recovery_to_markdown.py @@ -157,7 +157,12 @@ def replace_special_char(content): f"""
\n\t\n
""" ) 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":