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

Method parseCodeBlock

src/parser.js:167–174  ·  view source on GitHub ↗

* Parse code blocks (markers only) * @param {string} html - HTML line to parse * @returns {string|null} Parsed code fence or null

(html)

Source from the content-addressed store, hash-verified

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

Callers 2

parseLineMethod · 0.95
overtype.test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected