浏览代码

add space between index num and title text

gaotingquan 8 月之前
父节点
当前提交
1650693161
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      paddlex/inference/pipelines/layout_parsing/result_v2.py

+ 3 - 0
paddlex/inference/pipelines/layout_parsing/result_v2.py

@@ -242,6 +242,9 @@ class LayoutParsingResultV2(BaseCVResult, HtmlMixin, XlsxMixin, MarkdownMixin):
 
             def format_title(content_value):
                 content_value = content_value.rstrip(".")
+                content_value = re.sub(
+                    r"(\d+|[一二三四五六七八九十]+)([.、]?)\s*", r"\1\2 ", content_value
+                )
                 level = (
                     content_value.count(
                         ".",