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

Function renderInlineMarkdown

deployments/desktop/static/desktop.js:2609–2616  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

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

Callers 4

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

Calls 1

escapeHtmlFunction · 0.70

Tested by

no test coverage detected