light-sanitize-html

Lightweight plugin for sanitize your html

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
light-sanitize-html
1201.0.25 years ago5 years agoMinified + gzip package size for light-sanitize-html in KB

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