@locker/html-sanitizer
TypeScript icon, indicating that this package has built-in type declarations

0.22.3 • Public • Published

@locker/html-sanitizer

Lightning Web Security HTML and SVG sanitization utilities

This package provides a set of utilities to facilitate the sanitization of HTML and SVG using DOMPurify.

Features

  • Caching mechanism to store DOMPurify instances based on configuration objects. This avoids re-parsing the configuration object.
  • Utility functions meant to facilitate working with predefined configuration objects required by Locker in various scenarios, i.e sanitization of SVG strings, sanitization of Blob HTML content strings, sanitization of strings that are to be usd with innerHTML, outerHTML etc.
  • Hook for sanitizing SVG network resources (even if they are nested).

Readme

Keywords

none

Package Sidebar

Install

npm i @locker/html-sanitizer

Weekly Downloads

2,115

Version

0.22.3

License

SEE LICENSE IN LICENSE.txt

Unpacked Size

42.8 kB

Total Files

7

Last publish

Collaborators

  • achabot
  • garychangsf
  • mjasso
  • caridy
  • jdalton
  • t.lau
  • dejang
  • rwaldron