mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
fix: url sanitization
This commit is contained in:
parent
7d88264b43
commit
47b9e436d5
@ -245,7 +245,11 @@ async function updateReferences(thisStep: AnswerAction, allURLs: Record<string,
|
||||
if (!normalizedUrl) return null; // This causes the type error
|
||||
|
||||
return {
|
||||
exactQuote: ref?.exactQuote || '',
|
||||
exactQuote: (ref?.exactQuote ||
|
||||
allURLs[normalizedUrl]?.description ||
|
||||
allURLs[normalizedUrl]?.title || '')
|
||||
.replace(/[^\p{L}\p{N}\s]/gu, ' ')
|
||||
.replace(/\s+/g, ' '),
|
||||
title: allURLs[normalizedUrl]?.title || '',
|
||||
url: normalizedUrl,
|
||||
dateTime: ref?.dateTime || ''
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user