fix(chat): add \r? for regular expressions
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
1acab59fc7
commit
1b9e7e32bd
1 changed files with 2 additions and 2 deletions
|
|
@ -12,9 +12,9 @@ function parseLegacyToolFeedbackContent(
|
||||||
|
|
||||||
const toolName = match[1]?.trim() ?? ""
|
const toolName = match[1]?.trim() ?? ""
|
||||||
const body = match[2]?.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 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 [
|
return [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue