Skip to content

Commit

Permalink
修复一个span可能没有content导致的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
myhloli committed Mar 7, 2024
1 parent caa1588 commit 00f3e32
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions magic_pdf/dict2md/ocr_mkcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def mk_nlp_markdown(pdf_info_dict: dict):
for line in block['lines']:
line_text = ''
for span in line['spans']:
if not span.get('content'):
continue
content = span['content'].replace('$', '\$') # 转义$
if span['type'] == 'inline_equation':
content = f"${content}$"
Expand Down

0 comments on commit 00f3e32

Please sign in to comment.