入门指南
语法速查表
基本语法
标题语法
段落语法
换行语法
强调语法
引用语法
列表语法
代码语法
分隔线语法
链接语法
图片语法
转义字符语法
内嵌 HTML 标签
扩展语法
扩展语法可用性
表格
围栏代码块
脚注
标题编号
定义列表
删除线
任务列表语法
使用 Emoji 表情
Highlight
Subscript
自动网址链接
禁止自动将 URL 转换为链接
Hacks
Underline
Indent (Tab)
Center
Color
Comments
Admonitions
Image Size
Image Captions
Link Targets
Symbols
Table Formatting
Table of Contents
Videos
书写工具
换行语法 - markdown入门指南 - 笔下光年
网站首页
换行语法
在一行的末尾添加两个或多个空格,然后按回车键(return),即可创建一个换行(line break)或新行 (`<br/>`)。 <table class="table table-bordered"><thead class="thead-light"><tr><th>Markdown</th><th>HTML</th><th>渲染效果</th></tr></thead><tbody><tr><td><code class="highlighter-rouge">This is the first line. <br/>And this is the second line.</code></td><td><code class="highlighter-rouge"><p>This is the first line.<br><br/>And this is the second line.</p></code></td><td><p>This is the first line.<br/>And this is the second line.</p></td></tr></tbody></table> ## 换行(Line Break)用法的最佳实践 几乎每个 Markdown 应用程序都支持两个或多个空格进行换行 (称为 “结尾空格(trailing whitespace)”) 的方式,但这是有争议的,因为很难在编辑器中直接看到空格,并且很多人在每个句子后面都会有意或无意地添加两个空格。由于这个原因,你可能需要使用除结尾空格以外的其它方式来进行换行。如果你所使用的 Markdown 应用程序支持 HTML 的话,你可以使用 HTML 的 <code><br></code> 标签来实现换行。 为了兼容性,请在行尾添加“结尾空格”或 HTML 的 <code><br></code> 标签来实现换行。 还有两种其他方式我并不推荐使用。CommonMark 和其它几种轻量级标记语言支持在行尾添加反斜杠 (<code>\</code>) 的方式实现换行,但是并非所有 Markdown 应用程序都支持此种方式,因此从兼容性的角度来看,不推荐使用。并且至少有两种轻量级标记语言支持无须在行尾添加任何内容,只须键入回车键( return)即可实现换行。 <table class="table table-bordered"><thead class="thead-light"><tr><th>✅ 这样做</th><th>❌ 不要这样做</th></tr></thead><tbody><tr><td><code class="highlighter-rouge">First line with two spaces after. <br/>And the next line.<br/><br/>First line with the HTML tag after.<br><br/>And the next line.</code></td><td><code class="highlighter-rouge">First line with a backslash after.\<br/>And the next line.<br/><br/>First line with nothing after.<br/>And the next line.</code></td></tr></tbody></table>
上一篇:
段落语法
下一篇:
强调语法