Fix JSON escaping (#2461)

This commit is contained in:
YISH
2024-05-24 09:26:34 +08:00
committed by GitHub
parent 50c53de296
commit 82899d9d5d
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -780,7 +780,7 @@ export const getVariableValue = (
const variableValue = variableDict[path]
// Replace all occurrence
if (typeof variableValue === 'object') {
returnVal = returnVal.split(path).join(JSON.stringify(variableValue).replace(/"/g, '\\"'))
returnVal = returnVal.split(path).join(JSON.stringify(variableValue).replaceAll('"', '\\"').replaceAll('\\n', '\\\\n'))
} else {
returnVal = returnVal.split(path).join(variableValue)
}