# PasteCleanupOptions (@salmonui/rich-text)

> The PasteCleanupOptions interface of @salmonui/rich-text.

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

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

```ts
interface PasteCleanupOptions {
    mode?: PasteCleanupMode;
    allowedTags?: readonly string[];
    deniedTags?: readonly string[];
    allowedAttributes?: readonly string[];
    deniedAttributes?: readonly string[];
    keepWordFormatting?: boolean;
    embedHosts?: readonly string[];
    sanitize?: SanitizeHook;
    allow?: SanitizeAllow | readonly SanitizeAllow[];
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `mode` | `mode?: PasteCleanupMode;` | optional | `'keep'`: keep all formatting the vocabulary allows (fonts, sizes, colors, alignment); `'clean'` (default): keep structure, marks and links, drop presentational styles; `'plainText'`: text only, paragraphs and line breaks kept; `'prompt'`: the editor asks; here it behaves as `'clean'`. |
| `allowedTags` | `allowedTags?: readonly string[];` | optional | Only these elements survive (others are unwrapped, text kept). Vocabulary names (`strong`, not `b`). |
| `deniedTags` | `deniedTags?: readonly string[];` | optional | These elements are unwrapped (text kept). |
| `allowedAttributes` | `allowedAttributes?: readonly string[];` | optional | Only these attributes survive (`style` counts as one). |
| `deniedAttributes` | `deniedAttributes?: readonly string[];` | optional | These attributes are removed. |
| `keepWordFormatting` | `keepWordFormatting?: boolean;` | optional | In `'clean'` mode, keep the inline formatting of Word and Google Docs content. Default false. |
| `embedHosts` | `embedHosts?: readonly string[];` | optional | Passed to the sanitizer (see `SanitizeHtmlOptions`). |
| `sanitize` | `sanitize?: SanitizeHook;` | optional | Passed to the sanitizer, after the paste filters. |
| `allow` | `allow?: SanitizeAllow \| readonly SanitizeAllow[];` | optional | Passed to the sanitizer: extension elements and attributes. |
