[Canvas] Fix unescaped backslashes (#196311)

Fixes unescaped backslashes in Canvas autocomplete
This commit is contained in:
Nick Peihl 2024-10-15 15:05:24 -04:00 committed by GitHub
parent ceea2ce6a5
commit 7217b51452
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -439,7 +439,7 @@ function maybeQuote(value: any) {
if (value.match(/^\{.*\}$/)) {
return value;
}
return `"${value.replace(/"/g, '\\"')}"`;
return `"${value.replace(/[\\"]/g, '\\$&')}"`;
}
return value;
}