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 &&