Skip to content

buildSectionHierarchy

buildSectionHierarchy(blocks, entryFile?): (Section | Block)[]

Defined in: packages/speculator/src/parse/assembler.ts:76

Build section hierarchy from flat blocks

Converts headings to sections and nests content based on heading depth. Pre-existing sections (from HTML) are inserted at their natural position.

(Section | Block)[]

string

(Section | Block)[]