@locker/html-sanitizer
v0.22.8
Published
Lightning Web Security HTML and SVG sanitization utilities
Downloads
8,671
Keywords
Readme
@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).