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

Function mentionQueryAtCursor

deployments/desktop/static/desktop.js:4598–4609  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4596 anchor: source?.anchor || "",
4597 url: source?.url || metadata.url || metadata.abs_url || metadata.pdf_url || "",
4598 metadata
4599 };
4600 }
4601
4602 function normalizeCitations(data) {
4603 const raw = Array.isArray(data?.citations) && data.citations.length ? data.citations : data?.sources;
4604 const items = Array.isArray(raw) ? raw : DEMO_MODE ? demoSources : [];
4605 return items.map((source, index) => normalizeCitationSource(source, index));
4606 }
4607
4608 function renderAnswerWithCitations(text, citations = []) {
4609 const refs = new Map(citations.map((citation) => [String(citation.index), citation]));
4610 const escaped = escapeHtml(text || "");
4611 if (!escaped) return `<p>${escapeHtml(ui().chat.generating)}</p>`;
4612 const linked = escaped.replace(/\[(\d{1,3})\]/g, (match, index) => {

Callers 2

searchMentionSuggestionsFunction · 0.85
insertMentionFunction · 0.85

Calls 1

$Function · 0.70

Tested by

no test coverage detected