Skip to content

sanitizeHtml()

Sanitizes HTML using the default allowlist merged with custom DOMPurify config.

Example:

ts
sanitizeHtml('<img src=x onerror=alert(1) />');

Released under the MIT License.