* Parse code blocks (markers only) * @param {string} html - HTML line to parse * @returns {string|null} Parsed code fence or null
(html)
| 165 | * @returns {string|null} Parsed code fence or null |
| 166 | */ |
| 167 | static parseCodeBlock(html) { |
| 168 | // The line must start with three backticks and have no backticks after subsequent text |
| 169 | const codeFenceRegex = /^`{3}[^`]*$/; |
| 170 | if (codeFenceRegex.test(html)) { |
| 171 | return `<div><span class="code-fence">${html}</span></div>`; |
| 172 | } |
| 173 | return null; |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * Parse bold text |
no outgoing calls
no test coverage detected