Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.
Go agentagenticaichatbotdsh-pluginembeddingsevaluationgenerative-aigolangknowledge-basellmmulti-tenantollamaopenaiquestion-answeringragrerankingsemantic-searchvector-searchwiki
fix(chat): preserve image markdown during sanitize
qunbo.guo4a39081d53cd
diff --git a/frontend/src/views/chat/components/AgentStreamDisplay.vue b/frontend/src/views/chat/components/AgentStreamDisplay.vueindex 7e425647d..4ce439f47 100644--- a/frontend/src/views/chat/components/AgentStreamDisplay.vue+++ b/frontend/src/views/chat/components/AgentStreamDisplay.vue@@ -1396,8 +1396,20 @@ const getTokens = (content: any) => {return `\x00TAG${idx}\x00`;});- let sanitized = sanitizeForDisplay(preserved);+ // CRITICAL FIX: Also protect image URLs from sanitizeForDisplay+ // Extract image markdown  before sanitization+ const imagePlaceholders: string[] = [];+ const preservedWithImages = preserved.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, (match) => {+ const idx = imagePlaceholders.length;+ imagePlaceholders.push(match);+ return `\x00IMG${idx}\x00`;+ });++ let sanitized = sanitizeForDisplay(preservedWithImages);+ // Restore preserved images+ sanitized = sanitized.replace(/\x00IMG(\d+)\x00/g, (_, idx) => imagePlaceholders[Number(idx)]);+// Restore preserved tagssanitized = sanitized.replace(/\x00TAG(\d+)\x00/g, (_, idx) => tagPlaceholders[Number(idx)]);