sanitizeHTMLToDom
Official
Sanitize HTML to a DOM fragment.
Import:
import { sanitizeHTMLToDom } from 'obsidian';Signature:
function sanitizeHTMLToDom(html: string): DocumentFragmentParameters:
| Parameter | Type | Description |
|---|---|---|
html |
string | The HTML to sanitize. |
Returns: DocumentFragment — The sanitized DOM fragment.
Example:
console.log(sanitizeHTMLToDom('<div>foo</div>')); #document-fragment