mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 11:35:40 +01:00
Fixes regexp
This commit is contained in:
parent
c84c0cb8f9
commit
5744a230ae
1 changed files with 2 additions and 2 deletions
|
|
@ -247,12 +247,12 @@ export class PlaygroundModel {
|
||||||
const regexp = new RegExp(
|
const regexp = new RegExp(
|
||||||
"(\\b" +
|
"(\\b" +
|
||||||
escapeRegexpChars(codeStringName) +
|
escapeRegexpChars(codeStringName) +
|
||||||
":[^\\w`]*`)([^`\\\\\\n]|\\n|\\\\\\\\|\\\\|\\$`)*`"
|
":[^\\w`]*`)([^`\\\\\\n]|\\n|\\\\\\\\|\\\\\\`|\\\\\\$)*`"
|
||||||
);
|
);
|
||||||
const js = this.js;
|
const js = this.js;
|
||||||
const str = value
|
const str = value
|
||||||
.replaceAll("\\", "\\\\")
|
.replaceAll("\\", "\\\\")
|
||||||
.replaceAll("$", "\\$")
|
.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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue