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

Method parseBlockquote

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

Source from the content-addressed store, hash-verified

82 }
83
84 parseBlockquote(): TaggedBlock {
85 const contentLines: string[] = [];
86 while (true) {
87 this.skipWhitespace();
88 if (this.match('>')) {
89 if (this.peek() === ' ') this.consume();
90 const line = this.readUntil('\n');
91 contentLines.push(line);
92 if (!this.atEnd()) this.consume(); // Consume the newline
93 } else if (this.peek() === '\n') {
94 // Empty line within blockquote
95 contentLines.push('');
96 this.consume();
97 } else {
98 break;
99 }
100 }
101 const contentString = contentLines.join('\n');
102 const nestedParser = new MarkdownParser(contentString);
103 const contentBlocks = nestedParser.parseBlocks();
104 return {
105 tag: 'blockquote',
106 content: contentBlocks,
107 };
108 }
109
110 parseCodeBlock(): TaggedCodeBlock {
111 const language = this.readUntil('\n').trim();

Callers 1

parseBlockMethod · 0.95

Calls 7

skipWhitespaceMethod · 0.95
readUntilMethod · 0.95
parseBlocksMethod · 0.95
consumeMethod · 0.80
matchMethod · 0.65
peekMethod · 0.45
atEndMethod · 0.45

Tested by

no test coverage detected