exclusion regex: show unmodified regex string, avoid dropping the '\' when displaying escaped regexes (#1094)

This commit is contained in:
Ilya Kreymer 2023-08-22 10:16:23 -07:00 committed by GitHub
parent 4948e53cdb
commit 223571b18b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,10 +112,11 @@ export class QueueExclusionTable extends LiteElement {
this.results = this.exclusions
.slice((this.page - 1) * this.pageSize, this.page * this.pageSize)
.map((str: any) => {
const unescaped = str.replace(/\\/g, "");
return {
type: regexEscape(unescaped) === str ? "text" : "regex",
value: unescaped,
// if escaped version of string, with '\' removed matches string, then consider it
// to be matching text, otherwise, regex
type: regexEscape(str.replace(/\\/g, "")) === str ? "text" : "regex",
value: str,
};
});
}