3 ms·
That depends on the markdown implementation (like so many features). But most of them implement "two trailing spaces on previous line force line-break" so you c
by capableweb 4y ago
That depends on the markdown implementation (like so many features). But most of them implement "two trailing spaces on previous line force line-break" so you can (in most places) do something like this:
This is a paragraph with no linebreaks.
This is a paragraph with
one linebreak but without trailing spaces
This is a paragraph with one
line break and trailing spaces on previous line
That will render correctly on GitHub and other places (meaning, when rendered, the first one has no line-breaks, the second one has no line-breaks but the third one does [select the full third example to see the trailing spaces])
Here is a demo of it in action: https://jbt.github.io/markdown-editor/#dY3RCYAwDET/M8VN4DQuEDW0QWlLUnV9a/0QBCEQuLx7GaM62jAKGwfjEnFqjUgZmyaZTHj1gWj8ASkneUlMe+1xbrsaa7sEeOFZ/N+B2wG6LXg0nJZvvUEoJofm3ftDugA= https://jbt.github.io/markdown-editor/#dY3RCYAwDET/M8VN4DQuE...
- Beltalowda 4y agoThe two spaces-is-linebreak thing is in the commonmark specification, and has been a Markdown feature from the first Gruber Perl script, so it should be pretty compatible. The problem with it is that it's so "invisible" and that some editors/people have things setup to strip trailing whitespace by default. I wish there was a simpler way, like "@ at the end of a line indicates a hard line break", but at well.
- xigoi 4y agoSignificant trailing whitespace is awful. Many editors have it invisible and/or automatically remove it.