Socket
Socket
Sign inDemoInstall

light-sanitize-html

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    light-sanitize-html

Lightweight plugin for sanitize your html


Version published
Weekly downloads
215
increased by20.11%
Maintainers
1
Install size
22.7 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 18 May 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc