* Parse headers (h1-h3 only) * @param {string} html - HTML line to parse * @returns {string} Parsed HTML with header styling
(html)
| 85 | * @returns {string} Parsed HTML with header styling |
| 86 | */ |
| 87 | static parseHeader(html) { |
| 88 | return html.replace(/^(#{1,3})\s(.+)$/, (match, hashes, content) => { |
| 89 | const level = hashes.length; |
| 90 | content = this.parseInlineElements(content); |
| 91 | return `<h${level}><span class="syntax-marker">${hashes} </span>${content}</h${level}>`; |
| 92 | }); |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Parse horizontal rules |
no test coverage detected