unified

Project: rehypejs/rehype-minify

Package: rehype-minify-event-handler@2.0.3

  1. Dependencies: 0·Dependents: 2
  2. rehype plugin to Mminify event handler attributes
  1. unified 166
  2. plugin 130
  3. html 109
  4. rehype 73
  5. rehype-plugin 51
  6. minify 30
  7. mangle 30
  8. javascript 13
  9. script 10

rehype-minify-event-handler

Build Coverage Downloads Size Sponsors Backers Chat

Minify event handler attributes.

Install

npm:

npm install rehype-minify-event-handler

Use

On the API:

 unified()
   .use(require('rehype-parse'))
+  .use(require('rehype-minify-event-handler'))
   .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-event-handler > output.html

Example

In
<h1 onclick="javascript:alert(false)">Hello</h1>
Out
<h1 onclick="alert(!1)">Hello</h1>

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