evilstreak / markdown-js

A Markdown parser for javascript
7.7k stars 860 forks source link

New Line problem #283

Closed CosmaVito closed 7 years ago

CosmaVito commented 7 years ago

Hi in bootstrap markdown new line inside paragraph not work. I use markdown-js to obtein marked text. immagine

Instead if i put two spaces after the new line i have the correct result... immagine

why this strange behavior??

Has anyone found a solution?Thanks :)

kpcyrd commented 7 years ago

This is the correct way as described in the original markdown docs. :)

github uses a github flavored markdown, I'm currently looking for a way to enable the github linebreaking-way as well.

ashb commented 7 years ago

In the default Gruber dialect this can be achieved by having two trailing spaces on the end of the line. https://github.com/evilstreak/markdown-js/blob/master/test/features/linebreaks/simple.text -- i.e.

Line1  ¶
Line2¶

(where represents a new line. Otherwise it's a bit hard to see where the spaces are.)

I made a start of Github's flavor in the gfm branch but didn't finish it or need it in the end.