Skip to content

Commit

Permalink
Run pre-commits
Browse files Browse the repository at this point in the history
Signed-off-by: Maksym Lysak <[email protected]>
  • Loading branch information
Maksym Lysak committed Oct 25, 2024
1 parent a01c59b commit 7e245d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docling_core/types/doc/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -1298,8 +1298,9 @@ def export_to_markdown( # noqa: C901
# That means we need to escape it, to properly reflect content in the markdown
def escape_underscores(text):
# Replace "_" with "\_" only if it's not already escaped
escaped_text = re.sub(r'(?<!\\)_', r'\_', text)
escaped_text = re.sub(r"(?<!\\)_", r"\_", text)
return escaped_text

mdtext = escape_underscores(mdtext)

return mdtext
Expand Down

0 comments on commit 7e245d9

Please sign in to comment.