(text)
| 2607 | let codeLines = []; |
| 2608 | |
| 2609 | const renderInlineMarkdown = (text) => { |
| 2610 | let html = escapeHtml(text || ""); |
| 2611 | html = html.replace(/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g, '<a href="$2" target="_blank" rel="noreferrer">$1</a>'); |
| 2612 | html = html.replace(/`([^`]+)`/g, "<code>$1</code>"); |
| 2613 | html = html.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"); |
| 2614 | html = html.replace(/(^|[\s(])(https?:\/\/[^\s<)]+)/g, '$1<a href="$2" target="_blank" rel="noreferrer">$2</a>'); |
| 2615 | return html; |
| 2616 | }; |
| 2617 | const flushParagraph = () => { |
| 2618 | if (!paragraph.length) return; |
| 2619 | out.push(`<p>${renderInlineMarkdown(paragraph.join(" "))}</p>`); |
no test coverage detected