Merge pull request from microsoft/hediet/b/defensive-platypus

Escape $ in template strings
pull/3887/head^2
Henning Dieterichs committed by GitHub
commit 68f779a782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -251,7 +251,10 @@ export class PlaygroundModel {
);
debugger;
const js = this.js;
const str = value.replaceAll("\\", "\\\\").replaceAll("`", "\\`");
const str = value
.replaceAll("\\", "\\\\")
.replaceAll("$", "\\$")
.replaceAll("`", "\\`");
const newJs = js.replace(regexp, "$1" + str + "`");
const autoReload = this.settings.autoReload;
this.settings.autoReload = false;

Loading…
Cancel
Save