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