1.0.2 • Published 6 years ago

light-sanitize-html v1.0.2

Weekly downloads
232
License
MIT
Repository
github
Last release
6 years ago

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