()
| 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(); |
no test coverage detected