将HTML文本转换为Markdown格式文本。由JavaScript编写
npm:
npm install md-reverse
script引入:
<script src="../dist/md-reverse.browser.js" type="application/javascript"></script>
前往Github下载
import {MdReverse, TablePlugin, StrikethroughPlugin} from "md-reverse";
const mdReverse = new MdReverse();
mdReverse.toMarkdown(`<h1>Hello World!</h1>`);
// 使用插件扩展Table, Strikethrough语法
mdReverse.use(TablePlugin);
mdReverse.use(StrikethroughPlugin);
mdReverse.toMarkdown(`<h1><delHello World!</del></h1>`);
<script src="dist/md-reverse.browser.min.js"></script>
const mdReverse = new MdReverse();
mdReverse.toMarkdown(`<h1>Hello World!</h1>`);
// 使用插件扩展Table, Strikethrough语法
mdReverse.use(MdReverse.plugin['table']);
mdReverse.use(MdReverse.plugin['strikethrough']);
mdReverse.toMarkdown(`<h1><delHello World!</del></h1>`);