fn

parseTextSlice

Parse plain text: one block per line, blank lines dropped, ``` fences folded into a code block, and each line's leading marker resolved through the registry's input rules — so a markdown file pastes as headings, lists and quotes. A single line with no marker is inline: it joins the caret's line rather than splitting it.

Signature

ts
export function parseTextSlice(text: string, registry: Registry): Slice{ ... }

Parameters

ParameterTypeDescription
textstring—
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.