MCPcopy Create free account
hub / github.com/markmap/markmap / getCurrentHeading

Function getCurrentHeading

packages/markmap-html-parser/src/index.ts:168–177  ·  view source on GitHub ↗
(level: Levels)

Source from the content-addressed store, hash-verified

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);

Callers 1

checkNodesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected