Skip to content

Commit

Permalink
Minor: use long-form Unicode regex patterns for readability (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemaccana authored Aug 11, 2024
1 parent d83fe1b commit bec827b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/contentApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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, "-")
Expand Down

0 comments on commit bec827b

Please sign in to comment.