fix: keep whitespace inside fenced code blocks when normalizing results · microsoft/markitdown@7e6ed5c · GitHub
Skip to content

Commit 7e6ed5c

Browse files
committed
fix: keep whitespace inside fenced code blocks when normalizing results
MarkItDown._convert applied its whitespace cleanup (rstrip every line, collapse 3+ newlines to 2) to the entire converted document, which corrupted fenced code blocks: blank-line runs inside a fence collapsed and trailing spaces were stripped, changing code content. Track code fences while normalizing and leave their contents untouched. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
1 parent 945314a commit 7e6ed5c

2 files changed

Lines changed: 135 additions & 3 deletions

File tree

‎packages/markitdown/src/markitdown/_markitdown.py‎

Lines changed: 78 additions & 3 deletions
Lines changed: 57 additions & 0 deletions

0 commit comments

Comments
 (0)