Closed mrx23dot closed 7 months ago
I think you misunderstand the semantics of \
to be "insert a <br>
tag here", which it is not, per the spec:
A line break (not in a code span or HTML tag) that is preceded by two or more spaces and does not occur at the end of a block is parsed as a hard line break (rendered in HTML as a
tag)
and more specifically:
Hard line breaks are for separating inline content within a block. Neither syntax for hard line breaks works at the end of a paragraph or other block element
That said, Pandoc behaves the way you want, whether intentionally or by accident, I don't know.
I've found the suggestion on stackoverflow, but looks like it's only working with <10% of parsers.
Looks like the universal solution is <br>
which is not as practical.
The most intuitive would be to just parse new lines as breaks.
The semantics of HTML is also that <br>
is only sensical inside paragraphs, not at the end. The user on SO you are following is wrong.
So how do you recommend inserting 5 new lines in the output? Surely a markdown language would cover that.
Don't; because it's not a good idea.
HTML has meaning. Markdown is for generating those things with meaning too. It's not supposed to do things without meaning.
You can still abuse HTML. And CM allows that too: you can write those br tags (even though you shouldn't) in markdown.
produces
not 3 line breaks
https://spec.commonmark.org/dingus/?text=%23%23%20COMMON_STEPS%0A*%20test%201%0A%5C%0A%5C%0A%5C%0A*%20test%202%0A*%20test%203
Why make life harder? Simply allow any line breaks.