MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / parseHeading

Method parseHeading

src/common/markdown-block.ts:68–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66 }
67
68 parseHeading(): TaggedBlock {
69 let level = 1;
70 while (!this.atEnd() && this.peek() === '#' && level < 3) {
71 this.consume();
72 level++;
73 }
74 this.skipWhitespace();
75 const content = this.readUntil('\n');
76 const contentParsed = parseSpan(content.trim());
77 const tag: BlockTag = `h${level}` as 'h1' | 'h2' | 'h3';
78 return {
79 tag,
80 content: contentParsed,
81 };
82 }
83
84 parseBlockquote(): TaggedBlock {
85 const contentLines: string[] = [];

Callers 1

parseBlockMethod · 0.95

Calls 6

skipWhitespaceMethod · 0.95
readUntilMethod · 0.95
parseSpanFunction · 0.90
consumeMethod · 0.80
atEndMethod · 0.45
peekMethod · 0.45

Tested by

no test coverage detected