此 Markdown 语法 速查表 涵盖了从基本格式到高级元素的所有内容。将其用作日常参考或在转换文档时使用 WordToMD 并且需要清理输出。
文本格式
**Bold text**
*Italic text*
***Bold and italic***
~~Strikethrough~~
`Inline code`
| 语法 | 输出 |
|---|---|
**Bold** | 粗体 |
*Italic* | 斜体 |
***Bold and italic*** | 粗体和斜体 |
~~Strike~~ | |
`code` | code |
标题
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
完整参考: Markdown 标题指南
段落和换行符
First paragraph.
Second paragraph (blank line separates paragraphs).
First line
Second line (two trailing spaces create a line break)
列表
无序列表
- Item one
- Item two
- Nested item (indent 2 spaces)
- Another nested item
- Item three
同样有效: * or + 代替 -
有序列表
1. First item
2. Second item
1. Nested item
3. Third item
任务列表 (GFM)
- [x] Completed task
- [ ] Pending task
- [ ] Another pending task
链接
[Link text](https://example.com)
[Link with title](https://example.com "Hover title")
[Reference link][ref-id]
[ref-id]: https://example.com "Optional title"
Bare URL: https://example.com (GFM auto-links)
图像


![Reference image][img-id]
[img-id]: /path/to/image.png "Optional title"
块引用
> Single blockquote
> Multi-line blockquote
> continues on the next line
> Nested blockquote
> > Inner level
代码
内联代码
Use `console.log()` to debug.
防护代码块
```javascript
const x = 42;
console.log(x);
```
无语言的代码块
```
Plain preformatted text
no syntax highlighting
```
完整参考: Markdown 代码块指南
表格 (GFM)
| Header 1 | Header 2 | Header 3 |
|---|---|---|
| Cell | Cell | Cell |
| Cell | Cell | Cell |
列对齐
| Left | Center | Right |
|:---|:---:|---:|
| text | text | text |
完整参考: Markdown 表:完整指南
水平规则
---
***
___
(三个或更多连字符、星号或下划线)
Markdown 中的 HTML
大多数 Markdown 处理器都允许使用原始 HTML:
<details>
<summary>Click to expand</summary>
Hidden content here.
</details>
上标 <sup>text</sup>
下标 <sub>text</sub>
转义特殊字符
使用反斜杠转义 Markdown 字符:
\*Not italic\*
\# Not a heading
\| Not a table cell
可以转义的字符: \ * _ {} [] () # + - . ! |
脚注(扩展 Markdown)
This claim needs a source.[^1]
[^1]: Here is the footnote text.
GitHub 上不支持,但 Pandoc 和 MultiMarkdown 支持。
定义列表(扩展 Markdown)
Term
: Definition of the term
Another Term
: First definition
: Second definition
Pandoc Markdown 和一些静态站点生成器支持。
表情符号 (GFM)
:smile: :rocket: :warning: :check:
GitHub 和许多 Markdown 平台都支持表情符号短代码。
标题 (YAML)
由静态站点生成器和 Obsidian 使用:
---
title: "Document Title"
date: 2026-05-29
tags: [markdown, reference]
draft: false
---
必须是文件中的第一个内容,位于任何内容之前。
特定于平台的扩展
| 特点 | GitHub | Obsidian | GitBook | Notion |
|---|---|---|---|---|
| 任务列表 | ✅ | ✅ | ✅ | ✅ |
| 表格 | ✅ | ✅ | ✅ | ✅ |
| 脚注 | ❌ | ✅ | ✅ | ❌ |
维基链接 [[link]] | ❌ | ✅ | ❌ | ❌ |
数学 $formula$ | ✅ | ✅ | ✅ | ❌ |
| 美人鱼图 | ✅ | ✅ | ✅ | ❌ |
快速参考卡
| 元素 | 语法 |
|---|---|
| H1 | # Heading |
| H2 | ## Heading |
| 粗体 | **text** |
| 斜体 | *text* |
| 链接 | [text](url) |
| 图像 |  |
| 列表项 | - item |
| 编号 | 1. item |
| 代码 | `code` |
| 块代码 | ```lang |
| 报价 | > text |
| 表 | | col | col | |
| HR | --- |
| 任务 | - [ ] task |
| 删除线 | ~~text~~ |
| 逃脱 | \*literal\* |
将 Word 转换为 Markdown
有 Word 格式的文档吗? WordToMD 立即将 .docx 转换为 Markdown — 无需上传,无需帐户,完全免费。输出遵循适用于 GitHub、Obsidian、Notion 和所有主要平台的 GFM 语法。
另请参阅:
- 什么是 Markdown? — 对于绝对的初学者
- Markdown 标题指南
- Markdown 表:完整指南
- Markdown 代码块指南