mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 07:29:35 +08:00
fix: broken markdown footnote
This commit is contained in:
@@ -30,6 +30,7 @@ function buildMdFromAnswer(answer: AnswerAction) {
|
|||||||
if (answer.references?.length > 0) {
|
if (answer.references?.length > 0) {
|
||||||
refStr = `
|
refStr = `
|
||||||
<references>
|
<references>
|
||||||
|
|
||||||
${answer.references.map((ref, i) => {
|
${answer.references.map((ref, i) => {
|
||||||
// Escape special markdown characters in the quote
|
// Escape special markdown characters in the quote
|
||||||
const escapedQuote = ref.exactQuote
|
const escapedQuote = ref.exactQuote
|
||||||
@@ -37,8 +38,9 @@ ${answer.references.map((ref, i) => {
|
|||||||
.replace(/\n/g, ' ') // Replace line breaks with spaces
|
.replace(/\n/g, ' ') // Replace line breaks with spaces
|
||||||
.trim(); // Remove excess whitespace
|
.trim(); // Remove excess whitespace
|
||||||
|
|
||||||
return `[^${i + 1}]: [${escapedQuote}](${ref.url})`;
|
return `[^${i + 1}]: [${escapedQuote}](${ref.url})\n\n`;
|
||||||
}).join('\n')}
|
}).join()}
|
||||||
|
|
||||||
</references>
|
</references>
|
||||||
`.trim();
|
`.trim();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user