fn

parseDOMSlice

Read a DOM subtree into a fragment. Only the model comes out: no element of the source, no style, no attribute the rules did not ask for. Works on a detached (inert) document or a live one.

Signature

ts
export function parseDOMSlice(root: globalThis.Node, registry: Registry): Slice{ ... }

Parameters

ParameterTypeDescription
rootglobalThis.Node—
registryRegistry—

Returns

Slice
PropertyTypeDescription
blocksreadonly Node[]—
openStartbooleanThe first block's runs continue the block the caret is in — no boundary before them.
openEndbooleanThe last block stays open: the caret lands inside it and the tail of the split block joins it.