HTML转Markdown的JS库:to-markdown
采用JavaScript开发的HTML to Markdown转换器。
The API is as follows:
toMarkdown(stringOfHTML, options);
Installation
Browser
Download the compiled script located atdist/to-markdown.js.
<script src="PATH/TO/to-markdown.js"></script> <script>toMarkdown('<h1>Hello world!</h1>')</script>
Or with Bower:
$ bower install to-markdown
<script src="PATH/TO/bower_components/to-markdown/dist/to-markdown.js"></script> <script>toMarkdown('<h1>Hello world!</h1>')</script>
Node.js
Install theto-markdownmodule:
$ npm install to-markdown
Then you can use it like below:
var toMarkdown = require('to-markdown'); toMarkdown('<h1>Hello world!</h1>');
(Note it is no longer necessary to call.toMarkdownon the required module as of v1.)
本文由用户 d2dn 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!