what happens
converting markdown through MarkItDown corrupts fenced code blocks:
- two or more consecutive blank lines inside a fence collapse to one
- trailing spaces on lines inside a fence get stripped
def a():
pass
def b():
pass
comes back with the double blank line gone, and line with trailing spaces loses its spaces.
why
the result normalization (rstrip each line, collapse 3+ newline runs) runs over the whole document with no awareness of code fences, so it mangles content where whitespace is significant.
expected
whitespace inside fenced code blocks (``` or ~~~) survives exactly; normalization still applies to prose outside fences.
env: main 945314a
what happens
converting markdown through MarkItDown corrupts fenced code blocks:
comes back with the double blank line gone, and
line with trailing spacesloses its spaces.why
the result normalization (rstrip each line, collapse 3+ newline runs) runs over the whole document with no awareness of code fences, so it mangles content where whitespace is significant.
expected
whitespace inside fenced code blocks (``` or ~~~) survives exactly; normalization still applies to prose outside fences.
env: main
945314a