sanitize-html

utility security validation

sanitize-html is a library used to clean up user-submitted HTML, preserving only whitelisted elements and attributes on a per-element basis.

Latest Ver
Homepage
Github
0
3,974
📢 Safely processes user input to reduce security threats like XSS attacks.
License: MIT

Sample Code

⚠️ Some code, including import statements, may not run properly on jsFiddle. If it fails to execute, please copy the code and try it in your own environment.
📄 HTML
...

⚙️ JavaScript
var clean = sanitizeHtml('<p>some html</p>');console.log(clean);
⚡ Top Tools for Developers
Text Compare

Text Comparison

Easily spot the differences between two texts.

Favicon Generator

Favicon Generator

Quickly and easily generate favicons.

Lorem Ipsum Generator

Lorem Ipsum Generator

Generate placeholder text for your designs.

Character Counter

Character Counter

Check character and word count in real time.

SRT ↔ SMI

SRT ↔ SMI Converter

Easily convert between subtitle formats.

Text Extract(OCR)

Image Text Extractor

Automatically extract text from images.