Merge pull request #601 from DayuanJiang/fix/edit-diagram-json-quote-escaping

fix(chat): repair inconsistent quote escaping in edit_diagram JSON
This commit is contained in:
yujinze
2026-01-17 20:58:55 +09:00
committed by GitHub
+7
View File
@@ -473,6 +473,13 @@ ${userInputText}
inputToRepair = inputToRepair.replace(/:=/g, ": ")
// Fix `= "` instead of `: "`
inputToRepair = inputToRepair.replace(/=\s*"/g, ': "')
// Fix inconsistent quote escaping in XML attributes within JSON strings
// Pattern: attribute="value\" where opening quote is unescaped but closing is escaped
// Example: y="-20\" should be y=\"-20\"
inputToRepair = inputToRepair.replace(
/(\w+)="([^"]*?)\\"/g,
'$1=\\"$2\\"',
)
}
// Use jsonrepair to fix truncated JSON
const repairedInput = jsonrepair(inputToRepair)