mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-25 22:16:49 +08:00
fix: handle empty markdown string and footnote content
This commit is contained in:
parent
6c3ed9ba6d
commit
1d531ceffe
@ -164,6 +164,7 @@ ${formatReferences(references)}
|
||||
* It extracts existing footnote definitions and uses them as references
|
||||
*/
|
||||
export function repairMarkdownFootnotesOuter(markdownString: string): string {
|
||||
if (!markdownString) return '';
|
||||
// First trim the string to handle any extra whitespace
|
||||
markdownString = markdownString.trim();
|
||||
|
||||
@ -203,6 +204,7 @@ export function repairMarkdownFootnotesOuter(markdownString: string): string {
|
||||
let footnoteMatch;
|
||||
while ((footnoteMatch = footnoteDefRegex.exec(footnotesPart)) !== null) {
|
||||
// The footnote content
|
||||
if (!footnoteMatch[2]) continue;
|
||||
let content = footnoteMatch[2].trim();
|
||||
|
||||
// Extract URL and title if present
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user