# sanitizeHtml (@salmonui/rich-text)

> The sanitizeHtml function of @salmonui/rich-text: Sanitizes HTML against the shared vocabulary. Pure and server-safe: no DOM, no globals, deterministic, linear in the input size. sanitizeHtml(sanitizeHtml(x)) === sanitizeHtml(x).

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

```ts
import { sanitizeHtml } 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 sanitizeHtml(html: string, options?: SanitizeHtmlOptions): string;
```

Sanitizes HTML against the shared vocabulary. Pure and
server-safe: no DOM, no globals, deterministic, linear in the input size.
`sanitizeHtml(sanitizeHtml(x)) === sanitizeHtml(x)`.
