Markdown 预览与方言差异
左侧编写 Markdown,右侧实时 HTML 预览,支持完整 CommonMark 语法,全程在浏览器运行。
Markdown 预览与方言差异
CommonMark 减少歧义,但表格、脚注、任务列表仍因渲染器而异,发布到 GitHub 或内部 wiki 前建议对照预览。
导出 HTML 前先去除代码块中的令牌与密钥。
What the preview supports
The preview renders GitHub-Flavored Markdown (GFM) as you type: headings, emphasis, links, images, block quotes, ordered and unordered lists, inline code and fenced code blocks, horizontal rules, tables, task lists (- [ ] and - [x]), strikethrough (~~text~~) and automatic links for bare URLs.
Raw HTML is allowed — <kbd>, <sub>, <sup>, <details> and similar tags render as you would expect — but the output is sanitised, so scripts, event handlers such as onclick, and javascript: links are removed before anything is displayed. Copy HTML gives you that same sanitised markup, ready to paste into a CMS or an email template.
Syntax cheat sheet
# Heading 1 / ## Heading 2 / ### Heading 3 **bold** *italic* ~~strikethrough~~ `inline code` [link text](https://example.com)  > quoted text - bullet item 1. numbered item - [ ] open task - [x] done task --- (horizontal rule) | Column | Column | | --- | ---: | (:--- left, :---: centre, ---: right) ```js code block with a language label ```
Mistakes that change the output
- Missing blank lines: a list, table or heading directly after a paragraph line may be swallowed into the paragraph. Put a blank line before block elements.
- Single line breaks: one newline inside a paragraph does not start a new line in GFM. End the line with two spaces or a backslash, or leave a blank line for a new paragraph.
- Indentation in nested lists: sub-items must be indented to line up under the parent item’s text — two spaces after “- ”, three after “1. ”.
- Underscores in words: snake_case_names are left alone in GFM, but *asterisks* in the middle of words still create emphasis. Wrap identifiers in backticks.
- Pipes in tables: a literal | inside a table cell must be escaped as \|.
Where your Markdown will end up
GitHub, GitLab, VS Code, Obsidian and most static-site generators use GFM or a close relative, so what you see here is a reliable preview for README files, issues and documentation. Some platforms differ: Reddit and Discord support only a subset (Discord has no tables), Slack uses its own “mrkdwn” with *single asterisks* for bold, and Jira uses a separate wiki syntax. Footnotes, math ($…$) and diagrams (Mermaid) are platform extensions this preview does not render: math and Mermaid code appear as plain text, and footnote definitions are hidden.
Everything stays in your browser — nothing you type is uploaded — so it is safe for drafting internal documentation. The text is not saved either: copy your work out before closing the tab.
A README structure that works
Most good README files answer the same questions in the same order. Paste this skeleton into the editor and fill it in:
# Project name One sentence on what it does and who it is for. ## Installation ```bash npm install my-package ``` ## Usage The shortest example that works. ## Configuration | Option | Default | Description | | --- | --- | --- | | `debug` | `false` | Log extra detail | ## Contributing / License
Keep the first screen focused on what the project is and how to try it; move long reference material to separate pages and link to them.
Related tools
These free tools pair well with this page — open them in a new tab to finish your workflow.
常见问题
什么是Markdown?
Markdown是John Gruber于2004年创建的轻量级标记语言。它使用纯文本格式语法——如**粗体**、_斜体_和#标题——可转换为HTML。广泛用于README文件、文档和内容管理系统。
这个编辑器支持哪种Markdown方言?
此编辑器使用GitHub风格Markdown(GFM),这是最常见的标准。它扩展了标准Markdown,增加了表格、删除线文本(~~文字~~)、任务列表和可标注语言的围栏代码块等功能(预览以等宽字体显示代码,不做语法着色)。
如何在Markdown中创建表格?
使用管道符(|)和连字符(-)创建表格: | 标题1 | 标题2 | |-------|-------| | 单元格1 | 单元格2 | 每个标题单元格之间至少需要三个连字符。
我可以在Markdown中使用HTML吗?
可以,大多数Markdown解析器允许内联原始HTML标签。这在Markdown不支持的元素中很有用,例如<kbd>键盘</kbd>标签、带<span style>的彩色文本,或通过<sub>/<sup>实现下标/上标。
围栏代码块和缩进代码块有什么区别?
缩进代码块在每行前使用4个空格或制表符。围栏代码块在代码前后使用三个反引号(```或~~~),支持可选的语言提示以实现语法高亮,是现代首选的方式。