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 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!