vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Linebreak with other characters instead of 2 spaces #30

Closed FSX closed 13 years ago

FSX commented 13 years ago

Currently you can add two spaces at the end of a line and a linebreak (br) will be inserted.

I think it would be more user friendly to add an extension that replaces the two spaces with two other characters. Two spaces are not really visible, unless you make whitespace visible in your code editor. And when you have a "trim whitespace" function enabled the spaces disappear.

vmg commented 13 years ago

Any suggestions about which characters? Is anybody else doing something like this?

FSX commented 13 years ago

I initially thought about two backslashes, but that's annoying in strings and you need to escape them. Maybe ||, $$ or //.

I haven't seen anyone else doing something like this. I also took a quick look on the Markdown mailing list and didn't see anything similar.

c-spencer commented 13 years ago

I'd advise against $$ as that's commonly used for delimiting maths (for use with MathJax)

tbranyen commented 13 years ago

Can't you just put <br> at the end if you want to see something?

FSX commented 13 years ago

True, but I would like to prevent to mix Markdown and HTML is possible.

vmg commented 13 years ago

If no other parser has a feature like this one, we won't break the standard here. There are already to options, the double-space and a manual <br>, so I think those are plenty.

Yes, the two-space rule is kind of unfortunate, but most editors handle this gracefully on their Markdown mode (Vim, Textmate and Emacs do), so it's a non-issue.