View as Markdown

API reference: @salmonui/rich-text

parseHtmlfunction

import { parseHtml } from '@salmonui/rich-text';
function parseHtml(input: string): HtmlNode[];

Parses an HTML fragment into a tree. Never throws; malformed input yields the closest well-formed tree. <!DOCTYPE> is skipped, CDATA becomes text.