当前位置 : 主页 > 手机开发 > harmonyos >

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

来源:互联网 收集:自由互联 发布时间:2023-08-26
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 ht


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


上一篇:Node.js:实现遍历文件夹下所有文件
下一篇:没有了
网友评论