JSPM

light-sanitize-html

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 233
  • Score
    100M100P100Q90741F
  • License MIT

Lightweight plugin for sanitize your html

Package Exports

  • light-sanitize-html

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (light-sanitize-html) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

light-sanitize-html

Lightweight plugin for sanitize your html
CI status

Usage

const sanitize = require("light-sanitize-html");
let html = `
    <script>window.$ = false</script>
    <style></style>
    <p>
        some image
        <img src="javascript:alter('hello')" onerror="alert('world')">
    </p>
`;

html = sanitize(html);
html == `
    window.$ = false
    
    <p>
        some image
        <img  >
    </p>
`; // true