View as Markdown

API reference: @salmonui/rich-text

SanitizeHtmlOptionsinterface

import type { SanitizeHtmlOptions } from '@salmonui/rich-text';
interface SanitizeHtmlOptions {
    embedHosts?: readonly string[];
    sanitize?: SanitizeHook;
    blockIds?: boolean;
    allow?: SanitizeAllow | readonly SanitizeAllow[];
}
SanitizeHtmlOptions members (4)
NameSignatureDescription
embedHostsoptionalembedHosts?: readonly string[];

Hostnames whose <iframe src> embeds are kept (www.youtube-nocookie.com, or *.example.com for subdomains). Default: none, so iframes are dropped.

sanitizeoptionalsanitize?: SanitizeHook;

Further restriction, see SanitizeHook.

blockIdsoptionalblockIds?: boolean;

Keep data-block-id attributes (BlockEditor ids). Default: true.

allowoptionalallow?: SanitizeAllow | readonly SanitizeAllow[];

Elements and attributes editor extensions add. It can widen the vocabulary only with inert markup: script, style, iframe, object, embed, forms and foreign content, on* handlers, style and URL carriers other than href / cite / src / poster (checked by the URL rules) are refused.