@witchcraft/editor
    Preparing search index...

    Interface FileNodeOptions

    interface FileNodeOptions {
        onParseHTML?: (
            dom: HTMLElement,
            attrs: ParsedFileAttrs,
        ) => false | Partial<ParsedFileAttrs>;
        renderHTMLAsImage: (node: Node) => true;
    }
    Index
    onParseHTML?: (
        dom: HTMLElement,
        attrs: ParsedFileAttrs,
    ) => false | Partial<ParsedFileAttrs>

    Called when parsing HTML for file/image nodes. Allows validating or modifying parsed attributes before the node is created. Return false to reject, undefined to accept as-is, or a partial attrs object to override values.

    Type Declaration

    renderHTMLAsImage: (node: Node) => true

    Decide whether to render this node as an <img> or <div type="file"> in HTML output. Default: always render as <img>.