mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
Merge pull request #3912 from microsoft/hediet/b/defensive-platypus
Escape $ in template strings
This commit is contained in:
commit
68f779a782
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue