mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
fix: handle undefined exactQuote in formatReferences
This commit is contained in:
parent
854e8d82e8
commit
630f685cb6
@ -25,7 +25,7 @@ export function repairMarkdownFootnotes(
|
|||||||
// Helper function to format references
|
// Helper function to format references
|
||||||
const formatReferences = (refs: Array<Reference>) => {
|
const formatReferences = (refs: Array<Reference>) => {
|
||||||
return refs.map((ref, i) => {
|
return refs.map((ref, i) => {
|
||||||
const cleanQuote = ref.exactQuote
|
const cleanQuote = (ref?.exactQuote || '')
|
||||||
.replace(/[^\p{L}\p{N}\s]/gu, ' ')
|
.replace(/[^\p{L}\p{N}\s]/gu, ' ')
|
||||||
.replace(/\s+/g, ' ').trim();
|
.replace(/\s+/g, ' ').trim();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user