Escape $ in template strings

pull/3912/head
Henning Dieterichs 2 years ago
parent 2f51994ab5
commit 7d75202fb5
No known key found for this signature in database
GPG Key ID: 771381EFFDB9EC06

@ -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