From 591a540317e38a43122e3442dc9e18d78b68389d Mon Sep 17 00:00:00 2001 From: "ThetaLog(n)" Date: Thu, 22 Jan 2026 11:32:47 +0100 Subject: [PATCH] refactor: remove redundant character classes in slugify regex --- frontend/src/utils/slugify.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/slugify.ts b/frontend/src/utils/slugify.ts index 7ad05140dd..de766194e2 100644 --- a/frontend/src/utils/slugify.ts +++ b/frontend/src/utils/slugify.ts @@ -3,7 +3,7 @@ export default function slugify(text: string): string { .normalize('NFKD') // Normalize accented characters .replaceAll(/[\u0300-\u036F]/g, '') // Remove diacritics .replaceAll(/[^a-zA-Z0-9]+/g, '-') // Replace non-alphanumeric with hyphens - .replace(/^[-]+/, '') // Trim leading hyphens - .replace(/[-]+$/, '') // Trim trailing hyphens + .replace(/^-+/, '') // Trim leading hyphens + .replace(/-+$/, '') // Trim trailing hyphens .toLowerCase() }