Skip to main content

Module format_runs_query

Module format_runs_query 

Source
Expand description

Store-aware readers that synthesize inline content views from per-block format_runs + block_images. The canonical entry point is inline_segments_for_block, which returns the Vec<InlineSegment> view used by export, fragments, cursor, and tests.

Functions§

addressable_inline_pieces_for_block
The block’s inline pieces (text runs, images, footnote references), addressed in the document’s own addressable character space — the same space TextDocument:: to_addressable_text(), find_all match positions, and a block’s document_position all share. See crate::format_runs::AddressableInlinePiece’s doc comment for the hazard this closes: FormatRun/ImageAnchor offsets are UTF-8 bytes local to this one block, document-wide offsets are characters, and a caller bridging the two by hand (or not at all) is exactly how a comment anchored right after a table landed two characters off (see TextDocument::to_addressable_text’s doc comment for that incident).
get_block_footnote_refs
Fetch the footnote references anchored in a block.
get_block_images
Fetch the image anchors for a block.
get_format_runs
Fetch the format runs for a block. Returns an empty Vec if the block has no runs (treated the same as a missing entry).
inline_segments_for_block
Synthesize the Vec<InlineSegment> view for a block from its format_runs and block_images. Callers must pass the block’s plain_text (which they already have in scope from a prior get_block call) — this avoids re-locking the blocks table.