<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          marky-markdownnpm 的 markdown 解析器

          聯(lián)合創(chuàng)作 · 2023-10-02 05:49

          marky-markdown 是 npm 的官方 markdown 解析器,基于 NodeJS 編寫,旨在用 GitHub-style markdown 進(jìn)行奇偶校驗。它由一個最好的 CommonMark markdown 解析器——markdown-it 構(gòu)建。

          安裝

          npm install marky-markdown --save

          編程中使用

          marky-markdown 輸出單獨函數(shù)。為了基本使用,這個函數(shù)使用一個由字符串轉(zhuǎn)換而成的參數(shù)。

          var marky = require("marky-markdown")
          marky("# hello, I'm markdown").html()

          命令行使用

          你可以在 shell 中使用 marky-markdown 來解析 markdown 文件,最簡單的方法是全局安裝它。

          npm i -g marky-markdown
          marky-markdown some.md > some.html

          它能做什么

          • Parses markdown with markdown-it, a fast and commonmark-compliant parser.

          • Removes broken and malicious user input with sanitize-html

          • Applies syntax highlighting to GitHub-flavored code blocks using the highlights library from Atom.

          • Uses cheerio to perform various feats of DOM manipulation.

          • Converts :emoji:-style shortcuts to unicode emojis.

          • Converts headings (h1, h2, etc) into anchored hyperlinks.

          • Converts relative GitHub links to their absolute equivalents.

          • Converts relative GitHub images sources to their GitHub raw equivalents.

          • Converts insecure Gravatar URLs to HTTPS.

          • Converts list items with leading [ ] and [x] into GitHub-style task lists

          • Wraps embedded YouTube videos so they can be styled.

          • Parses and sanitizes package.description as markdown.

          • Applies CSS classes to redundant content that closely matches npm package name and description.

          • Applies CSS classes to badge images, so we can do something interesting with them one day.

          npm 包

          var package = {
            name: "foo",
            description: "foo is a thing",
            repository: {
              type: "git",
              url: "https://github.com/kung/foo"
            }
          }
          marky(
            "# hello, I am the foo readme",
            {package: package}
          ).html()
          瀏覽 18
          點贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧美bbb高朝 | 东方欧美亚洲色图 | 韩国久久久三级视频 | 国产美女被靠精品 | 免费av国产 |