Folds a markdown string into a tree of # H1 sections, each containing
## H2 sub-parts. Text between headings is captured as the body of the
nearest enclosing heading.
Errors only on truly structural problems (a ## H2 before any # H1,
non-blank text before the first heading). All higher-level validation
(which sections are allowed, which sub-parts must have bodies, etc.) is
left to the caller.
Folds a markdown string into a tree of
# H1sections, each containing## H2sub-parts. Text between headings is captured as the body of the nearest enclosing heading.Errors only on truly structural problems (a
## H2before any# H1, non-blank text before the first heading). All higher-level validation (which sections are allowed, which sub-parts must have bodies, etc.) is left to the caller.