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

Method parseParagraph

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

Source from the content-addressed store, hash-verified

219 }
220
221 parseParagraph(): TaggedBlock {
222 const contentLines: string[] = [];
223 while (!this.atEnd()) {
224 const line = this.peekLine();
225 if (
226 line.trim() === '' ||
227 line.startsWith('#') ||
228 line.startsWith('>') ||
229 line.startsWith('```') ||
230 line.startsWith(':::') ||
231 this.isListMarker(line.trim()) ||
232 line.startsWith('|')
233 ) {
234 break;
235 }
236 contentLines.push(this.readUntil('\n'));
237 if (!this.atEnd()) this.consume(); // Consume the newline
238 }
239 const contentText = contentLines.join('\n');
240 const contentParsed = parseSpan(contentText.trim());
241 return {
242 tag: 'paragraph',
243 content: contentParsed,
244 };
245 }
246
247 // Helper methods
248 skipWhitespace() {

Callers 1

parseBlockMethod · 0.95

Calls 6

peekLineMethod · 0.95
isListMarkerMethod · 0.95
readUntilMethod · 0.95
parseSpanFunction · 0.90
consumeMethod · 0.80
atEndMethod · 0.45

Tested by

no test coverage detected