(level: Levels)
| 166 | } |
| 167 | |
| 168 | function getCurrentHeading(level: Levels) { |
| 169 | let heading: IHtmlNode | undefined; |
| 170 | while ( |
| 171 | (heading = headingStack[headingStack.length - 1]) && |
| 172 | heading.level >= level |
| 173 | ) { |
| 174 | headingStack.pop(); |
| 175 | } |
| 176 | return heading || rootNode; |
| 177 | } |
| 178 | |
| 179 | function getContent($node: Cheerio<any>) { |
| 180 | const result = extractMagicComments($node); |