JS实现的Markdown解析器:markdown-it
g6d7
10年前
JS实现的Markdown解析器。100% CommonMark 支持,可扩展,语法高亮插件,速度快。
- Supports the CommonMark spec + syntax extensions + sugar (URL autolinking, typographer).
- Configurable syntax! You can add new rules and even replace existing ones.
- High speed!
- Community-written plugins and other packages on npm.
// node.js, "classic" way: var MarkdownIt = require('markdown-it'), md = new MarkdownIt(); var result = md.render('# markdown-it rulezz!'); // node.js, the same, but with sugar: var md = require('markdown-it')(); var result = md.render('# markdown-it rulezz!'); // browser without AMD, added to "window" on script load // Note, there are no dash. var md = window.markdownit(); var result = md.render('# markdown-it rulezz!');