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