@pangwu86/markdown-it-disable-url-encode

1.0.2 • Public • Published

markdown-it-disable-url-encode

本项目修改自 nanyuantingfeng/markdown-it-disable-url-encode 修正了一些 兼容性问题

Getting Started

npm install --save-dev @pangwu86/markdown-it-disable-url-encode

Usage

  const md = require("markdown-it")();  
  md.use(require("@pangwu86/markdown-it-disable-url-encode"), "./")
  // md.use(require("@pangwu86/markdown-it-disable-url-encode"), "*")
  // md.use(require("@pangwu86/markdown-it-disable-url-encode"), ".")
  // md.use(require("@pangwu86/markdown-it-disable-url-encode"), [...])
  // md.use(require("@pangwu86/markdown-it-disable-url-encode"), /.../)        


  const html = md.render("![image.png](图片/image.png)")
  // <p><img src="./图片/image.png" alt="image.png" /></p> 
 
  // without markdown-it-disable-url-encode plugin :
  // <p><img src="%E5%9B%BE%E7%89%87/image.png" alt="image.png" /></p>  

API

config rules: 0. undefined : use rule 1

  1. "*" : all paths will be decode

  2. "." : relative paths only

  3. "./" : relative paths only , just like "."

  4. string : as string[] to apply rule 5

  5. string[] : will be apply [].some() as result for detect if it needs to be decoded

  6. REGEXP : will be apply /^/.test() as result for detect if it needs to be decoded

Package Sidebar

Install

npm i @pangwu86/markdown-it-disable-url-encode

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

23.9 kB

Total Files

7

Last publish

Collaborators

  • pangwu86