克喵爱吃卤面

喵落阁

光就是一切的意义!
telegram
github
qq
email
x
bilibili

Markdown line break syntax

Original link: https://markdown.com.cn/basic-syntax/line-breaks.html

Markdown Line Break Syntax#

Add two or more spaces at the end of a line, then press the Enter key to create a line break (<br>).

Markdown SyntaxHTMLPreview Effect
This is the first line.
And this is the second line.
<p>This is the first line.<br>
And this is the second line.</p>

This is the first line.
And this is the second line.

Best Practices for Line Break Usage#

Almost every Markdown application supports adding two or more spaces for line breaks, known as trailing whitespace, but this is controversial because it is difficult to see spaces directly in the editor, and many people may intentionally or unintentionally add two spaces after each sentence. For this reason, you might want to use other methods for line breaks besides trailing whitespace. Fortunately, almost every Markdown application supports another way to create line breaks: the HTML <br> tag.

For compatibility, please add "trailing whitespace" or the HTML <br> tag at the end of the line to achieve line breaks.

There are two other methods that I do not recommend using. CommonMark and several other lightweight markup languages support adding a backslash (\) at the end of the line to create a line break, but not all Markdown applications support this method, so it is not recommended from a compatibility perspective. Additionally, at least two lightweight markup languages support creating line breaks without adding anything at the end of the line; simply pressing the Enter key (return) will suffice.

✅ Do this❌ Don't do this
First line with two spaces after.
And the next line.
First line with a backslash after.\
And the next line.
First line with the HTML tag after.<br>
And the next line.
First line with nothing after.
And the next line.
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.