# parseHtml (@salmonui/rich-text)

> The parseHtml function of @salmonui/rich-text: Parses an HTML fragment into a tree. Never throws; malformed input yields the closest well-formed tree. &lt;!DOCTYPE> is skipped, CDATA becomes text.

Canonical: https://salmonui.dev/docs/reference/rich-text/parseHtml

```ts
import { parseHtml } from '@salmonui/rich-text';
```

Entry index: https://salmonui.dev/docs/reference/rich-text (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/rich-text.md).

## Reference

Kind: function

```ts
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.
