light-sanitize-html
v1.0.2
Published
Lightweight plugin for sanitize your html
Downloads
1,252
Maintainers
Readme
light-sanitize-html
Lightweight plugin for sanitize your html
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