From 9c21d4ed3ba9ba8e53def7e1a1366b74834cb42d Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 11 Aug 2026 17:42:25 -0600 Subject: [PATCH] refac --- backend/open_webui/routers/retrieval.py | 1 + .../components/chat/Messages/Citations/CitationModal.svelte | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/retrieval.py b/backend/open_webui/routers/retrieval.py index f92f30d4f2..464a2b233b 100644 --- a/backend/open_webui/routers/retrieval.py +++ b/backend/open_webui/routers/retrieval.py @@ -2397,6 +2397,7 @@ async def process_web( 'status': True, 'collection_name': collection_name, 'filename': form_data.url, + 'content': content, 'file': { 'data': { 'content': content, diff --git a/src/lib/components/chat/Messages/Citations/CitationModal.svelte b/src/lib/components/chat/Messages/Citations/CitationModal.svelte index 01a8de686e..a259beef11 100644 --- a/src/lib/components/chat/Messages/Citations/CitationModal.svelte +++ b/src/lib/components/chat/Messages/Citations/CitationModal.svelte @@ -41,7 +41,7 @@ $: if (citation) { expandedDocs = new Set(); - mergedDocuments = citation.document?.map((c, i) => { + mergedDocuments = (citation.document ?? []).map((c, i) => { return { source: citation.source, document: c, @@ -223,7 +223,7 @@ title={$i18n.t('Content')} > {:else} - {@const rawContent = document.document.trim().replace(/\n\n+/g, '\n\n')} + {@const rawContent = (document.document ?? '').trim().replace(/\n\n+/g, '\n\n')} {@const isTruncated = ($settings?.renderMarkdownInPreviews ?? true) && rawContent.length > CONTENT_PREVIEW_LIMIT &&