From adb087415cf29786fd1ac22d6d7f36bdb9c6a66b Mon Sep 17 00:00:00 2001 From: Han Xiao Date: Wed, 19 Mar 2025 18:47:26 +0800 Subject: [PATCH] fix: md footnote --- src/agent.ts | 4 ++-- src/utils/text-tools.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agent.ts b/src/agent.ts index 7b192e1..7fa8eb0 100644 --- a/src/agent.ts +++ b/src/agent.ts @@ -37,7 +37,7 @@ import { buildMdFromAnswer, chooseK, fixCodeBlockIndentation, removeExtraLineBreaks, - removeHTMLtags, repairMarkdownFootnotesSimple + removeHTMLtags, repairMarkdownFootnotesOuter } from "./utils/text-tools"; import {MAX_QUERIES_PER_STEP, MAX_REFLECT_PER_STEP, MAX_URLS_PER_STEP, Schemas} from "./utils/schemas"; import {formatDateBasedOnType, formatDateRange} from "./utils/date-tools"; @@ -916,7 +916,7 @@ But unfortunately, you failed to solve the issue. You need to think out of the b (thisStep as AnswerAction).mdAnswer = fixBadURLMdLinks( fixCodeBlockIndentation( - repairMarkdownFootnotesSimple( + repairMarkdownFootnotesOuter( await fixMarkdown( buildMdFromAnswer((thisStep as AnswerAction)), allKnowledge, diff --git a/src/utils/text-tools.ts b/src/utils/text-tools.ts index 46f7fcb..1297ce9 100644 --- a/src/utils/text-tools.ts +++ b/src/utils/text-tools.ts @@ -159,7 +159,7 @@ ${formatReferences(references)} * A variant of the function that only takes a markdown string * It extracts existing footnote definitions and uses them as references */ -export function repairMarkdownFootnotesSimple(markdownString: string): string { +export function repairMarkdownFootnotesOuter(markdownString: string): string { // Remove outer code fence if it exists // First trim the string to handle any extra whitespace markdownString = markdownString.trim();