unified

Project: rehypejs/rehype-minify

Package: rehype-minify-javascript-url@3.0.3

  1. Dependencies: 0·Dependents: 2
  2. rehype plugin to minify JavaScript URLs
  1. unified 166
  2. plugin 130
  3. html 109
  4. rehype 73
  5. rehype-plugin 51
  6. minify 30
  7. mangle 30
  8. javascript 14
  9. url 11
  10. script 10

rehype-minify-javascript-url

Build Coverage Downloads Size Sponsors Backers Chat

Minify JavaScript URLs.

Install

npm:

npm install rehype-minify-javascript-url

Use

On the API:

 unified()
   .use(require('rehype-parse'))
+  .use(require('rehype-minify-javascript-url'))
   .use(require('rehype-stringify'))
   .process('<span>some html</span>', function (err, file) {
     console.error(report(err || file))
     console.log(String(file))
   })

On the CLI:

rehype input.html --use minify-javascript-url > output.html

Example

In
<img src="javascript:alert(true)">
Out
<img src="javascript:alert(!0)">

Contribute

See contributing.md in rehypejs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer