MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / renderInlineMarkdown

Function renderInlineMarkdown

deployments/desktop/static/reports.js:117–124  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

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");

Callers 4

flushParagraphFunction · 0.70
flushListFunction · 0.70
flushQuoteFunction · 0.70
renderMarkdownFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected