# SanitizeHookResult (@salmonui/rich-text)

> The SanitizeHookResult type of @salmonui/rich-text: What the sanitize hook returns for an element: - undefined / 'keep': keep it as is; - null / 'remove': remove it with its content; - 'unwrap': remove the element and keep its content; - { attrs }: keep it with these attributes. Only names the element already has are accepted and every value is validated again by the built-in rules, so the hook can drop or narrow attributes but never add one or re-enable a value the sanitizer refused.

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

```ts
import type { SanitizeHookResult } 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 SanitizeHookResult = undefined | null | 'keep' | 'remove' | 'unwrap' | {
    attrs: Record<string, string>;
};
```

What the `sanitize` hook returns for an element:
- `undefined` / `'keep'`: keep it as is;
- `null` / `'remove'`: remove it with its content;
- `'unwrap'`: remove the element and keep its content;
- `{ attrs }`: keep it with these attributes. Only names the element
  already has are accepted and every value is validated again by the
  built-in rules, so the hook can drop or narrow attributes but never add
  one or re-enable a value the sanitizer refused.
