Skip to content

Config

Unofficial

Configuration options for DOMPurify sanitization.

Import:

import type { Config } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface Config

Properties

PropertyTypeDescription
ADD_ATTR?string[]Additional attributes to allow.
ADD_DATA_URI_TAGS?string[]Additional data URI tags to allow.
ADD_TAGS?string[]Additional tags to allow.
ADD_URI_SAFE_ATTR?string[]Additional URI-safe attributes to allow.
ALLOW_ARIA_ATTR?booleanWhether to allow ARIA attributes.
ALLOW_DATA_ATTR?booleanWhether to allow data attributes.
ALLOW_UNKNOWN_PROTOCOLS?booleanWhether to allow unknown protocols in URLs.
ALLOWED_ATTR?string[]List of allowed attributes.
ALLOWED_NAMESPACES?string[]List of allowed namespaces.
ALLOWED_TAGS?string[]List of allowed tags.
ALLOWED_URI_REGEXP?RegExpRegular expression for allowed URI patterns.
CUSTOM_ELEMENT_HANDLING?CustomElementHandlingCustom element handling configuration.
FORBID_ATTR?string[]List of forbidden attributes.
FORBID_CONTENTS?string[]List of forbidden content types.
FORBID_TAGS?string[]List of forbidden tags.
FORCE_BODY?booleanWhether to force the use of the body element.
IN_PLACE?booleanWhether to sanitize in place.
KEEP_CONTENT?booleanWhether to keep content of removed elements.
NAMESPACE?stringNamespace for the parsed document.
PARSER_MEDIA_TYPE?stringMedia type for the parser.
RETURN_DOM_FRAGMENT?booleanWhether to return a DocumentFragment instead of a string.
RETURN_DOM_IMPORT?booleanWhether to import the returned DOM node into the current document.
RETURN_DOM?booleanWhether to return a DOM node instead of a string.
RETURN_TRUSTED_TYPE?booleanWhether to return a Trusted Type object instead of a string.
SAFE_FOR_TEMPLATES?booleanWhether to enable safe-for-templates mode.
SANITIZE_DOM?booleanWhether to sanitize DOM clobbering attacks.
SANITIZE_NAMED_PROPS?booleanWhether to sanitize named properties.
USE_PROFILES?ConfigUseProfiles | falseProfiles to use for sanitization.
WHOLE_DOCUMENT?booleanWhether to sanitize the whole document.