MCPcopy Index your code
hub / github.com/markmap/markmap / getLevel

Function getLevel

packages/markmap-html-parser/src/index.ts:98–103  ·  view source on GitHub ↗
(tagName: string)

Source from the content-addressed store, hash-verified

96const SELECTOR_LIST_ITEM = /^li$/;
97
98function getLevel(tagName: string) {
99 if (SELECTOR_HEADING.test(tagName)) return +tagName[1] as Levels;
100 if (SELECTOR_LIST.test(tagName)) return Levels.List;
101 if (SELECTOR_LIST_ITEM.test(tagName)) return Levels.ListItem;
102 return Levels.Block;
103}
104
105export function parseHtml(html: string, opts?: Partial<IHtmlParserOptions>) {
106 const options = {

Callers 1

checkNodesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected