View as Markdown

API reference: @salmonui/rich-text

RichTextPasteCleanupinterface

import type { RichTextPasteCleanup } from '@salmonui/rich-text';
interface RichTextPasteCleanup extends Omit<PasteCleanupOptions, 'embedHosts' | 'sanitize'> {
}
RichTextPasteCleanup members (7, 7 inherited)
NameSignatureDescription
modeoptionalinheritedmode?: PasteCleanupMode;

'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'.

allowedTagsoptionalinheritedallowedTags?: readonly string[];

Only these elements survive (others are unwrapped, text kept). Vocabulary names (strong, not b).

deniedTagsoptionalinheriteddeniedTags?: readonly string[];

These elements are unwrapped (text kept).

allowedAttributesoptionalinheritedallowedAttributes?: readonly string[];

Only these attributes survive (style counts as one).

deniedAttributesoptionalinheriteddeniedAttributes?: readonly string[];

These attributes are removed.

keepWordFormattingoptionalinheritedkeepWordFormatting?: boolean;

In 'clean' mode, keep the inline formatting of Word and Google Docs content. Default false.

allowoptionalinheritedallow?: readonly SanitizeAllow[] | SanitizeAllow;

Passed to the sanitizer: extension elements and attributes.