Skip to main content

DOM

sanitize(dirty, options)

Sanitizes DOM content. A wrapper for the dompurify package, pre-configured to allow EDS components. Prevents XSS attacks.

Usage: window.e.utils.v2.dom.sanitize(dirty, options)

Parameters

NameTypeRequiredDescription
dirtyHTMLElementyesThe HTML content to sanitize
optionsobjectnoSettings passed to DOMPurify

Returns: The sanitized content.