From bec827b27a056af4a1de8fa75066d97a66e35e9e Mon Sep 17 00:00:00 2001 From: Mike MacCana Date: Sun, 11 Aug 2024 00:03:01 -0400 Subject: [PATCH] Minor: use long-form Unicode regex patterns for readability (#14) --- src/utils/contentApi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/contentApi.ts b/src/utils/contentApi.ts index a173bab9c..8ddce6663 100644 --- a/src/utils/contentApi.ts +++ b/src/utils/contentApi.ts @@ -354,7 +354,7 @@ export default class ContentApi { // we remove any special characters from the end of the label // to make it look cleaner in the UI // @ts-ignore - label = label.replace(/[^\p{L}\p{N}]+$/u, ""); + label = label.replace(/[^\p{Letter}\p{Number}]+$/u, ""); // if (!duplicator.has(label)) { // duplicator.set(label, 0); @@ -391,7 +391,7 @@ export default class ContentApi { .replace(/\s+/g, "-") .replace(/\./g, "") // @ts-ignore - .replace(/[^\p{L}\p{N}]+/gu, "-") + .replace(/[^\p{Letter}\p{Number}]+/gu, "-") .replace(/^-/g, "") .replace(/-$/g, "") .replace(/--+/g, "-")