Skip to content

Commit ccde54a

Browse files
authored
fix: suppress warning for missing fallback case (#184)
chore: suppress warning for missing fallback case Signed-off-by: Yusik Kim <[email protected]>
1 parent ee2d67b commit ccde54a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docling_core/types/doc/document.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,7 +2848,7 @@ def _image_fallback(item: TextItem):
28482848

28492849
# Building a math equation in MathML format
28502850
# ref https://www.w3.org/TR/wai-aria-1.1/#math
2851-
elif formula_to_mathml:
2851+
elif formula_to_mathml and len(math_formula) > 0:
28522852
try:
28532853
mathml_element = latex2mathml.converter.convert_to_element(
28542854
math_formula, display="block"
@@ -2870,7 +2870,7 @@ def _image_fallback(item: TextItem):
28702870
and img_fallback is not None
28712871
):
28722872
text = img_fallback
2873-
elif len(math_formula) > 0:
2873+
else:
28742874
text = f"<pre>{math_formula}</pre>"
28752875

28762876
elif math_formula != "":

0 commit comments

Comments
 (0)