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

Method parseInlineElements

src/parser.js:430–444  ·  view source on GitHub ↗

* Parse all inline elements in correct order * @param {string} text - Text with potential inline markdown * @returns {string} HTML with all inline styling

(text)

Source from the content-addressed store, hash-verified

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

Callers 5

parseHeaderMethod · 0.95
parseBulletListMethod · 0.95
parseTaskListMethod · 0.95
parseNumberedListMethod · 0.95
parseLineMethod · 0.95

Calls 5

parseStrikethroughMethod · 0.95
parseBoldMethod · 0.95
parseItalicMethod · 0.95

Tested by

no test coverage detected