View as Markdown

API reference: @salmonui/rich-text

SanitizeElementinterface

import type { SanitizeElement } from '@salmonui/rich-text';
interface SanitizeElement {
    readonly tag: string;
    readonly attrs: Readonly<Record<string, string>>;
    readonly parent: string | null;
}

A sanitized element as the sanitize hook sees it (read-only copy).

SanitizeElement members (3)
NameSignatureDescription
tagreadonly tag: string;

Lowercase tag name from the vocabulary (p, a, img, span, ...).

attrsreadonly attrs: Readonly<Record<string, string>>;

The attributes that survived the built-in rules.

parentreadonly parent: string | null;

Tag of the sanitized parent element, or null at the top level.