Visual Studio Code 是一个源代码编辑器。它是可扩展的、免费的、开源的和跨平台的。它的成功在很大程度上归功于其活跃的扩展开发人员社区。每当它缺少某个功能时,通常会有一个扩展来修复该缺点。其开箱即用的 Markdown 支持包括:

  • CommonMark 支持
  • 语法高亮显示
  • 预览
  • 自动完成
  • 主题
  • 代码样式

它不支持 WYSIWIG 编辑。虽然 Visual Studio Code 没有将 Markdown 导出为任何其他格式的开箱即用功能,但它可以在语法着色保持不变的情况下复制 Markdown 代码。

Visual Studio Code

Visual Studio Marketplace 中提供的 Markdown 扩展通过以下功能对其进行了扩展:

  • 扩展语法(例如 “Markdown Extended”)
  • Markdown 代码格式(例如 “Prettier - Code formatter”)
  • 导出为其他格式(例如“Markdown Preview Enhanced”)
  • UI 元素(例如 “Markdown Shortcuts”)
  • 扩展了 markdown 语法高亮显示(例如“One Dark Pro”)
  • Linting (例如 “markdownlint”) – 这是开发人员的一个功能,但对于普通作家来说是一个巨大的烦恼
  • 适用于不同服务的样式合规性工具包(例如,用于 Microsoft Docs 的“Docs Authoring Pack”)
  • 拼写检查(例如“Code Spell Checker”)

Visual Studio Code, with Markdown Preview Enhanced, Markdownlint, and One Dark Pro

VS Code Markdown 支持

VS Code 为以下 Markdown 元素提供支持。

Element Support Notes
Headings Yes
Paragraphs Yes
Line Breaks Yes
Bold Yes
Italic Yes
Blockquotes Yes
Ordered Lists Yes
Unordered Lists Yes
Code Yes
Horizontal Rules Yes
Links Yes
Images Yes Image display in preview is subject to content security policy, adjustable from the drop-down menu to the top-right
Tables Yes
Fenced Code Blocks Yes
Syntax Highlighting Yes
Footnotes Partial In code editor only. Comprehensive support requires the Markdown Preview Enhanced extension.
Heading IDs Partial Does not support custom IDs. Comprehensive support requires the Markdown Preview Enhanced extension.
Definition Lists Partial Requires the Markdown Preview Enhanced extension.
Strikethrough Partial Two tildes () only. ~~word~~
Task Lists Partial One of the many readily available extensions can add this feature, e.g. Markdown Preview Enhanced.
Emoji (copy and paste) Yes
Emoji (shortcodes) Partial Requires the Markdown Preview Enhanced extension.
Highlight No
Subscript No
Superscript No
Automatic URL Linking Yes
Disabling Automatic URL Linking Yes
HTML Yes

另请参阅

将您的 Markdown 技能提升到一个新的水平。

在 60 页中学习 Markdown。《Markdown 指南》专为新手和专家设计,是一本全面的参考书,包含您入门和掌握 Markdown 语法所需的一切。

获取书籍