Optional
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.
false
undefined
The raw DOM element being parsed.
The attrs extracted from the DOM element.
Decide whether to render this node as an <img> or <div type="file"> in HTML output. Default: always render as <img>.
<img>
<div type="file">
Called when parsing HTML for file/image nodes. Allows validating or modifying parsed attributes before the node is created. Return
falseto reject,undefinedto accept as-is, or a partial attrs object to override values.