Kaynağa Gözat

fix(ocr_mkcontent): add spaces around inline equation in content

Ensure proper formatting of inline equations by adding spaces outside the equation delimitersto prevent markdown from interpreting the equation content as part of a link. This addresses
the issue where inline OCR equations appear without the correct markdown formatting.
myhloli 1 yıl önce
ebeveyn
işleme
0998d22a32
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      magic_pdf/dict2md/ocr_mkcontent.py

+ 1 - 1
magic_pdf/dict2md/ocr_mkcontent.py

@@ -168,7 +168,7 @@ def merge_para_with_text(para_block):
                 else:
                     content = ocr_escape_special_markdown_char(content)
             elif span_type == ContentType.InlineEquation:
-                content = f"${span['content']}$"
+                content = f" ${span['content']}$ "
             elif span_type == ContentType.InterlineEquation:
                 content = f"\n$$\n{span['content']}\n$$\n"