Line break in Markdown
There are a few different methods to enforce a line break in the same paragraph in Markdown syntax: HTML’s <br />
, backslash and double space. Let’s consider each case.
HTML tag
First of all, because Markdown syntax allows using simple HTML, the <br />
tag is one option.
This is the first line<br />
And this is another line...
Markdown, however, is a format that should be easy to write and easy to read. HTML tags, don’t matter how simple they are, in my opinion, make the document a bit messy.
My rule of thumb is simple – I should be able to read the Markdown text comfortably even if it’s not parsed.
Backslash
The second option supported by some Markdown parsers (like Goldmark that Hugo uses) is the backslash as the last character in the line.
This is the first line\
And this is another line...
Much better than the line break tag in HTML. It’s a good choice for people who write single paragraphs across many lines and need a visual indicator of the line break.
Two spaces
Fortunately, there is also an option for me. Two spaces at the end of the line also produce a line break.
This is the first line{space}{space}
And this is another line...
I don’t use to split paragraphs across multiple lines. That’s why I don’t need any particular indicator that tells me there is a line break. The actual line break is sufficient for me by itself.