From 223571b18bda40cd4fec9cd164741de99e513384 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Tue, 22 Aug 2023 10:16:23 -0700 Subject: [PATCH] exclusion regex: show unmodified regex string, avoid dropping the '\' when displaying escaped regexes (#1094) --- frontend/src/components/queue-exclusion-table.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/queue-exclusion-table.ts b/frontend/src/components/queue-exclusion-table.ts index 8d25b655..e55fc937 100644 --- a/frontend/src/components/queue-exclusion-table.ts +++ b/frontend/src/components/queue-exclusion-table.ts @@ -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, }; }); }