MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / buildQAHtml

Function buildQAHtml

deepwiki/deepwiki.ts:600–609  ·  view source on GitHub ↗
(headerLines: string[], question: string, answerMarkdown: string, collapseSafe: boolean)

Source from the content-addressed store, hash-verified

598};
599
600const buildQAHtml = (headerLines: string[], question: string, answerMarkdown: string, collapseSafe: boolean): string => {
601 const header = headerLines.filter(Boolean).join("\n");
602 const safeQ = escapeHtml(question);
603 const htmlA = TelegramFormatter.markdownToHtml(answerMarkdown, { collapseSafe });
604
605 const qBlock = collapseSafe ? `Q:\n<blockquote expandable>${safeQ}</blockquote>\n` : `Q:\n${safeQ}\n`;
606 const aBlock = collapseSafe ? `A:\n<blockquote expandable>${htmlA}</blockquote>` : `A:\n${htmlA}`;
607
608 return header ? `${header}\n${qBlock}${aBlock}` : `${qBlock}${aBlock}`;
609};
610
611const toIdString = (v: any): string => {
612 try {

Callers 1

sendAnswerOrTelegraphMethod · 0.85

Calls 1

escapeHtmlFunction · 0.70

Tested by

no test coverage detected