Try adding 2 spaces (or a backslash \
) after the first line:
[Name of link](url)
My line of text\
Visually:
[Name of link](url)<space><space>
My line of text\
Output:
<p><a href="url">Name of link</a><br>
My line of text<br></p>
Alternatively you can place a <br>
directly into the text. It is valid in Markdown.
I know this post is about adding a single line break but I thought I would mention that you can create multiple line breaks with the backslash (\
) character:
Hello
\
\
\
World!
This would result in 3 new lines after "Hello". To clarify, that would mean 2 empty lines between "Hello" and "World!". It would display like this:
World!
Personally I find this cleaner for a large number of line breaks compared to using <br>
.
Note that backslashes are not recommended for compatibility reasons. So this may not be supported by your Markdown parser but it's handy when it is.
After a long search, I found this solution:
\
\
This will produce:
<br> <br>
Combining answers from multiple sources, there are mainly 3 ways to add a line break in Markdown:
\
)Add a backslash at the end of a line like this:
Markdown Input | HTML Output | HTML Preview |
---|---|---|
Test line\ |
|
Test line Test line 2 |
<br>
tagLot of HTML Tags are directly supported in markdown. Add a HTML <br>
or ` tag at the end of a line like this:
Markdown Input | HTML Output | HTML Preview |
---|---|---|
Test line |
|
Test line Test line 2 |
Add 2 spaces at the end of a line like this:
Markdown Input | HTML Output | HTML Preview |
---|---|---|
Test line |
|
Test line Test line 2 |
Option3.2 for whitespace - if you would like to be able to see the spaces while editing markdown source, add \s
instead of whitespace(
)
Note: Option3.2 doesn't seem to work properly, but this is documented in the markdown guide
Test line\s\s
Test line 2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With