Media and embed node specs to merge into a schema:
new Schema({ nodes: { ...defaultNodes(), ...embedNodes(options) }, marks: … }).
options decides which hosts an <iframe> may point at. The core HTML
parser drops <iframe> wholesale unless a schema rule claims the tag; the
iframeEmbed rule below is that claim, and its getAttrs is what stands
between a pasted frame and the document, so the same allowlist is
consulted on import, on insert and on render.
The attachment and linkCard nodes render as <a> so exported HTML
stays a working download link / preview card without this package's
stylesheet. Note that core's link mark claims every <a href> on import
and marks are matched before nodes, so when a schema also includes
defaultMarks() those two nodes re-import as plain links to the same
target rather than as nodes; video, audio and iframeEmbed round-trip
in every schema.
Media and embed node specs to merge into a schema:
new Schema({ nodes: { ...defaultNodes(), ...embedNodes(options) }, marks: … }).optionsdecides which hosts an<iframe>may point at. The core HTML parser drops<iframe>wholesale unless a schema rule claims the tag; theiframeEmbedrule below is that claim, and itsgetAttrsis what stands between a pasted frame and the document, so the same allowlist is consulted on import, on insert and on render.The
attachmentandlinkCardnodes render as<a>so exported HTML stays a working download link / preview card without this package's stylesheet. Note that core'slinkmark claims every<a href>on import and marks are matched before nodes, so when a schema also includesdefaultMarks()those two nodes re-import as plain links to the same target rather than as nodes;video,audioandiframeEmbedround-trip in every schema.