(text)
| 115 | } |
| 116 | |
| 117 | function renderInlineMarkdown(text) { |
| 118 | let html = window.escapeHtml ? window.escapeHtml(text || "") : String(text || ""); |
| 119 | html = html.replace(/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g, '<a href="$2" target="_blank" rel="noreferrer">$1</a>'); |
| 120 | html = html.replace(/`([^`]+)`/g, "<code>$1</code>"); |
| 121 | html = html.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"); |
| 122 | html = html.replace(/(^|[\s(])(https?:\/\/[^\s<)]+)/g, '$1<a href="$2" target="_blank" rel="noreferrer">$2</a>'); |
| 123 | return html; |
| 124 | } |
| 125 | |
| 126 | function renderMarkdown(markdown) { |
| 127 | const lines = String(markdown || "").replace(/\r\n/g, "\n").split("\n"); |
no outgoing calls
no test coverage detected