Looking for advice on the most future-proof / canonical way to add line breaks in my writing. I have the Strict Line Breaks option turned ON because I want to stick as close as possible to standard markdown rendering so when I open notes in other programs, they render the same.
I am aware of these 3 methods:
this way uses standard HTML <br> tag:
this way works<br />
but is ugly & ^^ tedious!
This way uses a \ at the line ending (nb: does not render correctly in some viewers e.g. QLMarkdown):
.....uses a ^backslash
and lastly this one, which looks pretty & seems to render in most apps, but I don’t love it because you can’t tell from looking at it which lines have the spaces:
puts 2 spaces ^^ here
Which way are you guys using? Or is there any better method I am not aware of?
I think ideally I would like method #3 if I could somehow make the 2 spaces visible somehow (maybe with CSS?)
Right, this line break issue creates a dilemma. I have switched scrict line breaks off, but as you say, this is a deviation from the Markdown standard.
I also really dislike the MarkDown syntax with the two whitespaces at the end. Actually I think it’s a design failure in Markdown. First, as you say, they are not visible unless you use the “show whitespace” plugin, but more importantly, many text editors silently remove white space at the end of lines when saving (which makes sense for many reasons, e.g. version control and diffing). Also, why does Markdown want two whitespaces?
I try to avoid line breaks as much as I can. Usually they are required for code,
so I use a block code when I need them, but I cannot format content inside it.
AFAIC the 3 options you mentioned are the only ones that exist.
Making the 2 spaces visible with CSS or a plugin as Cito says could be an option, but as he also adds:
many text editors silently remove white space at the end of lines when saving
I think the HTML alternatives - using the <br /> tag or the   entity - break the simplicity and clarity of markdown. You can solve almost any need you have with HTML inside an MD file and it’s the most compatible solution. Why don’t we use <table> too?
Backlash to the rescue
The backslash \ seems to be the best way to achieve this (to me at least). As you state, some pure md editors won’t render them correctly, even though it is considered as an option in the CommonMark Spec for the Hard line breaks:
For a more visible alternative, a backslash before the line ending may be used instead of two spaces: Example 631
Thank you @andrezgz for your thoughtful reply. I agree & try to avoid linebreaks when possible. When I have to use them, somehow I find myself adapting to the xxx__ 2 spaces at the line ending. It just looks the cleanest.
Just as you say: this is how you tell the output in HTML that you want a page break to occur, not line break. Since Markdown is based on HTML, it’s not that far-fetched to see this working in a Markdown parser.
The how-to is rather simple: everywhere that you want a page break to occur in your printed document (alas, you need pages for it to work, right?), you insert this line of code. The nice thing is that this line is conveniently hidden in preview mode, so that you can format for print while your normal preview is unaffected.
Does that clarify? Please write if something is still unclear.