Skip to main content

blocks_to_html

Function blocks_to_html 

Source
pub fn blocks_to_html(
    roots: &[Block],
    by_id: &HashMap<BlockId, Block>,
) -> String
Expand description

Clipboard-oriented serialiser. Mirrors the React blocksToHtml: emits toggle blocks in Notion’s canonical nested format and consumes indent-based siblings as toggle children.

The by_id map uses the default hasher — this is deliberate. We don’t generalize over BuildHasher because callers always build this map themselves from editor state (never from a custom-hasher container) and the generic bound would only add noise to the public API.