js:marked实现markdown解析并生成html

marked is A markdown parser and compiler. Built for speed.

文档

  • https://github.com/markedjs/marked
  • https://marked.js.org/

安装

npm install marked

使用

import { marked } from 'marked';
// or const { marked } = require('marked');

const html = marked.parse('# Marked in Node.js\n\nRendered by **marked**.');

另一个解析器:markdown-it

你可能感兴趣的:(javascript,html,开发语言)