Commit 00f3e329 authored by 赵小蒙's avatar 赵小蒙

修复一个span可能没有content导致的问题

parent caa1588a
...@@ -10,6 +10,8 @@ def mk_nlp_markdown(pdf_info_dict: dict): ...@@ -10,6 +10,8 @@ def mk_nlp_markdown(pdf_info_dict: dict):
for line in block['lines']: for line in block['lines']:
line_text = '' line_text = ''
for span in line['spans']: for span in line['spans']:
if not span.get('content'):
continue
content = span['content'].replace('$', '\$') # 转义$ content = span['content'].replace('$', '\$') # 转义$
if span['type'] == 'inline_equation': if span['type'] == 'inline_equation':
content = f"${content}$" content = f"${content}$"
......
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