MCPcopy Index your code
hub / github.com/panphora/overtype / parseHeader

Method parseHeader

src/parser.js:87–93  ·  view source on GitHub ↗

* Parse headers (h1-h3 only) * @param {string} html - HTML line to parse * @returns {string} Parsed HTML with header styling

(html)

Source from the content-addressed store, hash-verified

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

Callers 1

parseLineMethod · 0.95

Calls 1

parseInlineElementsMethod · 0.95

Tested by

no test coverage detected