Function: extractMarkdownHeadingSection()
ts
function extractMarkdownHeadingSection(rawMarkdown, heading): string;Defined in: markdown/src/parser/internal/parse-markdown-frontmatter.ts:57
Extracts the Markdown body text under a specific ATX heading up to the next heading of equal or higher rank.
Walks top-level mdast heading nodes (ignoring # lines inside fenced code blocks) and slices the section content up to the next heading with depth <= targetDepth.
Parameters
| Parameter | Type | Description |
|---|---|---|
rawMarkdown | string | Raw UTF-8 Markdown document text. |
heading | string | Target heading title (with or without leading # characters). |
Returns
string
Trimmed Markdown content beneath heading.
Throws
If heading is not found in rawMarkdown.