Skip to content

Commit 195998a

Browse files
committed
mk_mm_markdown2中span_type分类更新
1 parent 25a0fd0 commit 195998a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

magic_pdf/dict2md/ocr_mkcontent.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ def mk_mm_markdown2(pdf_info_dict:dict):
6666
for line in para:
6767
for span in line['spans']:
6868
span_type = span.get('type')
69-
if span_type == 'text':
69+
if span_type == ContentType.Text:
7070
para_text += span['content']
71-
elif span_type == 'inline_equation':
71+
elif span_type == ContentType.InlineEquation:
7272
para_text += f" ${span['content']}$ "
73-
elif span_type == 'displayed_equation':
73+
elif span_type == ContentType.InterlineEquation:
7474
para_text += f"$$\n{span['content']}\n$$ "
75-
elif span_type == 'image':
75+
elif span_type == ContentType.Image:
7676
para_text += f"![](s3://mllm-raw-media/pdf2md_img/{span['image_path']}) "
7777
markdown.append(para_text)
7878

0 commit comments

Comments
 (0)