DOMPurifyI.sanitize method
DOMPurifyI › sanitize
Unofficial
Sanitize a string or DOM node.Signature:
sanitize(source: string | Node): stringParameters:
| Parameter | Type | Description |
|---|---|---|
| source | string | Node | The input to sanitize. |
Returns: string — The sanitized string.
Unofficial
Sanitize a string or DOM node and return a DocumentFragment.Signature:
sanitize(source: string | Node, config: Config & ConfigReturnDomFragment): DocumentFragmentParameters:
| Parameter | Type | Description |
|---|---|---|
| source | string | Node | The input to sanitize. |
| config | Config & ConfigReturnDomFragment | Configuration with RETURN_DOM_FRAGMENT enabled. |
Returns: DocumentFragment — The sanitized DocumentFragment.
Unofficial
Sanitize a string or DOM node and return an HTMLElement.Signature:
sanitize(source: string | Node, config: Config & ConfigReturnDom): HTMLElementParameters:
| Parameter | Type | Description |
|---|---|---|
| source | string | Node | The input to sanitize. |
| config | Config & ConfigReturnDom | Configuration with RETURN_DOM enabled. |
Returns: HTMLElement — The sanitized HTMLElement.
Unofficial
Sanitize a string or DOM node with custom configuration.Signature:
sanitize(source: string | Node, config: Config): stringParameters:
| Parameter | Type | Description |
|---|---|---|
| source | string | Node | The input to sanitize. |
| config | Config | The sanitization configuration. |
Returns: string — The sanitized string.