fix(chat): add \r? for regular expressions

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
LCandCopilot authored and GitHub committed 2026-04-26 19:59:55 +08:00
1 parent 1acab59fc7
commit 1b9e7e32bd
1 file changed
+2 -2
+2 -2
View File
@@ -12,9 +12,9 @@ function parseLegacyToolFeedbackContent(
const toolName = match[1]?.trim() ?? ""
const body = match[2]?.trim() ?? ""
const codeFence = /```(?:json)?\n([\s\S]*?)\n```/m.exec(body)
const codeFence = /```(?:json)?\r?\n([\s\S]*?)\r?\n```/m.exec(body)
const argumentsText = codeFence?.[1]?.trim() ?? ""
const explanation = body.replace(/```(?:json)?\n[\s\S]*?\n```/gm, "").trim()
const explanation = body.replace(/```(?:json)?\r?\n[\s\S]*?\r?\n```/gm, "").trim()
return [
{