Sanitize
The config utility is used to sanitize DOM content, it is a wrapper for dompurify package with preconfiguration for allowing EDS components.
DOMPurify is a highly effective and widely adopted JavaScript library for sanitizing HTML and preventing cross-site scripting (XSS) attacks. By removing potentially malicious code and ensuring that only safe HTML elements and attributes are retained, DOMPurify significantly enhances the security of web applications that handle user-provided HTML content. Its robust configuration options allow developers fine-grained control over the sanitization process, making it a versatile and essential tool for building secure web experiences.
Usage
Name | Description |
---|---|
window.e.utils.v2.dom.sanitize(dirty, options) |
Returns a sanitized HTML content |
Parameters
Name | Description | Type | Required | Default value |
---|---|---|---|---|
dirty |
html content | HTMLElement |
yes | |
options |
Settings for dompurify | no |
Returns
The sanitized content