Fix JSON escaping (better) (#2498)

Fix JSON escaping
This commit is contained in:
YISH 2024-05-30 19:58:20 +08:00 committed by GitHub
parent eb738a1552
commit d50563765e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

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).replaceAll('"', '\\"').replaceAll('\\n', '\\\\n'))
returnVal = returnVal.split(path).join(JSON.stringify(JSON.stringify(variableValue)))
} else {
returnVal = returnVal.split(path).join(variableValue)
}