Fixes regexp
parent
c84c0cb8f9
commit
5744a230ae
|
@ -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…
Reference in New Issue