markdown-it-rust / markdown-it

markdown-it js library rewritten in rust
Other
79 stars 9 forks source link

wrong sourcemaps for `\r\n` #1

Closed rlidwka closed 2 years ago

rlidwka commented 2 years ago

Output of these two runs should be the same:

$ echo -e 'test\n\n***' | ./mdit --sourcepos
<p data-sourcepos="1:1-1:4">test</p>
<hr data-sourcepos="3:1-3:3">
$ echo -e 'test\r\n\r\n***' | ./mdit --sourcepos
<p data-sourcepos="1:1-1:4">test</p>
<hr data-sourcepos="2:1-3:1">

It's not currently because line endings get normalized.