Markdown解析器,100%支持CommonMark标准。快速且易于扩展。

趋势

markdown-it

CI NPM version Coverage Status

Markdown parser done right. Fast and easy to extend.

Live demo

  • Follows the CommonMark spec + adds syntax extensions & sugar (URL autolinking, typographer).
  • Configurable syntax! You can add new rules and even replace existing ones.
  • High speed.
  • Safe by default.
  • Community-written plugins and other packages on npm.

Note

If you are upgrading to v15, see the migration guide.

Install (node.js):
npm install markdown-it

For a quick look at dist/ folder contents, see https://unpkg.com/markdown-it/. For browser you can use unpkg.com, esm.sh or any other CDN, which mirror npm registry.

Usage
import MarkdownIt from 'markdown-it'
const md = new MarkdownIt()
const result = md.render('# markdown-it rulezz!')

More usage examples.

关于
Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed
21.9 k
1.8 k
178
语言
TypeScript
JavaScript
CSS
HTML
68.3%
27.12%
3%
1.58%