* Parse all inline elements in correct order * @param {string} text - Text with potential inline markdown * @returns {string} HTML with all inline styling
(text)
| 428 | * @returns {string} HTML with all inline styling |
| 429 | */ |
| 430 | static parseInlineElements(text) { |
| 431 | // Step 1: Identify and protect sanctuaries (code and links) |
| 432 | const { protectedText, sanctuaries } = this.identifyAndProtectSanctuaries(text); |
| 433 | |
| 434 | // Step 2: Parse other inline elements on protected text |
| 435 | let html = protectedText; |
| 436 | html = this.parseStrikethrough(html); |
| 437 | html = this.parseBold(html); |
| 438 | html = this.parseItalic(html); |
| 439 | |
| 440 | // Step 3: Restore and transform sanctuaries |
| 441 | html = this.restoreAndTransformSanctuaries(html, sanctuaries); |
| 442 | |
| 443 | return html; |
| 444 | } |
| 445 | |
| 446 | /** |
| 447 | * Parse a single line of markdown |
no test coverage detected