Fixes regexp

pull/3994/head
Henning Dieterichs 2023-06-02 00:52:09 +02:00
parent c84c0cb8f9
commit 5744a230ae
No known key found for this signature in database
GPG Key ID: 771381EFFDB9EC06
1 changed files with 2 additions and 2 deletions

View File

@ -247,12 +247,12 @@ export class PlaygroundModel {
const regexp = new RegExp(
"(\\b" +
escapeRegexpChars(codeStringName) +
":[^\\w`]*`)([^`\\\\\\n]|\\n|\\\\\\\\|\\\\|\\$`)*`"
":[^\\w`]*`)([^`\\\\\\n]|\\n|\\\\\\\\|\\\\\\`|\\\\\\$)*`"
);
const js = this.js;
const str = value
.replaceAll("\\", "\\\\")
.replaceAll("$", "\\$")
.replaceAll("$", "\\$$$$")
.replaceAll("`", "\\`");
const newJs = js.replace(regexp, "$1" + str + "`");
const autoReload = this.settings.autoReload;