diff --git a/docling/backend/md_backend.py b/docling/backend/md_backend.py index 5b3043b9..a1de7f5a 100644 --- a/docling/backend/md_backend.py +++ b/docling/backend/md_backend.py @@ -27,6 +27,8 @@ _log = logging.getLogger(__name__) class MarkdownDocumentBackend(DeclarativeDocumentBackend): def clean_md(self, md_text): + # Long sequences of unescaped underscore symbols "_" hangs parser + # Up to 3 characters "___" are allowed to represent italic, bold, and bold-italic res_text = md_text.replace("____", "") return res_text