Markdown 列表语法
发布时间:2026-10-10 | 浏览:1
可以将多个条目组织成有序或无序列表。
要创建有序列表,请在每个列表项前添加数字并紧跟一个英文句点。数字不必按数学顺序排列,但是列表应当以数字 1 起始。
Third item Indented item Indented item
CommonMark 以及其他一些轻量级标记语言允许你使用右括号 ) 作为分隔符(例如: 1) First item ),但并非所有 Markdown 应用都支持这种写法,因此从兼容性的角度来看,这并不是一个理想的选择。为了保证兼容性,请只使用句点( . )。
要创建无序列表,请在每个列表项前面添加破折号 (-)、星号 (*) 或加号 (+) 。缩进一个或多个列表项可创建嵌套列表。
Third item Indented item Indented item
不同的 Markdown 应用在如何处理同一个列表中使用不同分隔符的问题上并不一致。为了兼容性,不要在同一个列表中混合使用多种分隔符——请选择一种,并始终保持一致。
要在保留列表连续性的同时在列表中添加另一种元素,请将该元素缩进四个空格或一个制表符,如下例所示:
This is the first list item.
Here's the second list item. I need to add another paragraph below the second list item.
And here's the third list item.
This is the first list item.
Here's the second list item. A blockquote would look great below the second list item.
A blockquote would look great below the second list item.
And here's the third list item.
代码块 通常采用四个空格或一个制表符缩进。当它们被放在列表中时,请将它们缩进八个空格或两个制表符。
Find the following code block on line 21: <html> <head> <title>Test</title> </head>
Find the following code block on line 21:
Update the title to match the name of your website.
Update the title to match the name of your website.
Open the file containing the Linux mascot.
Marvel at its beauty.
Close the file.
你可以在有序列表中嵌套无序列表,反之亦然。
Third item Indented item Indented item