developit / snarkdown

:smirk_cat: A snarky 1kb Markdown parser written in JavaScript
http://jsfiddle.net/developit/828w6t1x/
MIT License
2.28k stars 110 forks source link

\r\n ignored (not producing newlines) #69

Open then0rTh opened 5 years ago

then0rTh commented 5 years ago

Solved it by .replace(/\r\n/g, '\n') prior to parsing.

Feel free to [won't fix] this issue - \r\n are weird anyway.

swyxio commented 2 years ago

ran into this too - without it, my newlines was parsing like this

image

and with this replacement it parses like this:

image

still not a clean fix (newlines are condensed) but progress.

swyxio commented 2 years ago

the newlines not being paragraphs look like a known issue, i guess. https://github.com/developit/snarkdown/issues/11

i tried this replacement strategy https://github.com/developit/snarkdown/issues/11#issuecomment-813364966 and it worked for me.