🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

light-sanitize-html

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

light-sanitize-html

Lightweight plugin for sanitize your html

1.0.2
latest
Source
npm
Version published
Weekly downloads
349
24.64%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

xss

FAQs

Package last updated on 18 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts