mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 18:32:56 +01:00
Escape $ in template strings
This commit is contained in:
parent
2f51994ab5
commit
7d75202fb5
1 changed files with 4 additions and 1 deletions
|
|
@ -251,7 +251,10 @@ export class PlaygroundModel {
|
||||||
);
|
);
|
||||||
debugger;
|
debugger;
|
||||||
const js = this.js;
|
const js = this.js;
|
||||||
const str = value.replaceAll("\\", "\\\\").replaceAll("`", "\\`");
|
const str = value
|
||||||
|
.replaceAll("\\", "\\\\")
|
||||||
|
.replaceAll("$", "\\$")
|
||||||
|
.replaceAll("`", "\\`");
|
||||||
const newJs = js.replace(regexp, "$1" + str + "`");
|
const newJs = js.replace(regexp, "$1" + str + "`");
|
||||||
const autoReload = this.settings.autoReload;
|
const autoReload = this.settings.autoReload;
|
||||||
this.settings.autoReload = false;
|
this.settings.autoReload = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue