* Adjusts the headings in the given `markdown` to be in a given heading context. * Headings must start in a line. * Preceding whitespace or any other character will result in the heading not being recognized. * * @example `withHeadingContext(2, '# Heading') === '### Heading'` * @param {number}
(relativeHeadingLevel, markdown)
| 91 | * @param {string} markdown |
| 92 | */ |
| 93 | function withHeadingContext(relativeHeadingLevel, markdown) { |
| 94 | return markdown.replaceAll(/^(#+)/gm, (match, markdownHeadingTokens) => { |
| 95 | return "#".repeat(markdownHeadingTokens.length + relativeHeadingLevel); |
| 96 | }); |
| 97 | } |
| 98 | |
| 99 | function generateContentForSection(options) { |
| 100 | const { |
no outgoing calls
no test coverage detected