Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
00f3e329
Commit
00f3e329
authored
Mar 07, 2024
by
赵小蒙
Browse files
修复一个span可能没有content导致的问题
parent
caa1588a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
magic_pdf/dict2md/ocr_mkcontent.py
magic_pdf/dict2md/ocr_mkcontent.py
+2
-0
No files found.
magic_pdf/dict2md/ocr_mkcontent.py
View file @
00f3e329
...
...
@@ -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
}
$"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment