From 541da3b27b7b6b45cfb2a8682dacd72a6c6b144b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 5 Nov 2021 14:12:32 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixes=20#84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/utils/Slug.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/Slug.ts b/frontend/src/utils/Slug.ts index 072b54c..22f7b4e 100644 --- a/frontend/src/utils/Slug.ts +++ b/frontend/src/utils/Slug.ts @@ -1,3 +1,3 @@ export function toSlug(str: string): string { - return str.replaceAll(/[^A-Za-z0-9-]/g, "-").toLowerCase() -} \ No newline at end of file + return str.replaceAll(/[^A-Za-z0-9-]/g, " ").trim().replaceAll(" ", "-").toLowerCase() +}