# SanitizeHook (@salmonui/rich-text)

> The SanitizeHook type of @salmonui/rich-text: Extension hook (sanitize). It runs after the built-in allow-list, on every element of the sanitized tree, parents before children. It can only remove or further restrict content; the built-in sanitizing cannot be turned off or widened through it.

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

```ts
import type { SanitizeHook } 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: type

```ts
type SanitizeHook = (element: SanitizeElement) => SanitizeHookResult;
```

Extension hook (`sanitize`). It
runs after the built-in allow-list, on every element of the sanitized tree,
parents before children. It can only remove or further restrict content;
the built-in sanitizing cannot be turned off or widened through it.
