Fixed bug with the sluggify

This commit is contained in:
DrMint 2022-03-28 13:17:30 +02:00
parent 3a397d7eea
commit 575e81019a
1 changed files with 12 additions and 12 deletions

View File

@ -280,19 +280,19 @@ export function slugify(string: string | undefined): string {
return ""; return "";
} }
return string return string
.replace(/[ÀÁÂÃÄÅàáâãäåæÆ]/u, "a") .replace(/[ÀÁÂÃÄÅàáâãäåæÆ]/g, "a")
.replace(/[çÇ]/u, "c") .replace(/[çÇ]/gu, "c")
.replace(/[ðÐ]/u, "d") .replace(/[ðÐ]/gu, "d")
.replace(/[ÈÉÊËéèêë]/u, "e") .replace(/[ÈÉÊËéèêë]/gu, "e")
.replace(/[ÏïÎîÍíÌì]/u, "i") .replace(/[ÏïÎîÍíÌì]/gu, "i")
.replace(/[Ññ]/u, "n") .replace(/[Ññ]/gu, "n")
.replace(/[øØœŒÕõÔôÓóÒò]/u, "o") .replace(/[øØœŒÕõÔôÓóÒò]/gu, "o")
.replace(/[ÜüÛûÚúÙù]/u, "u") .replace(/[ÜüÛûÚúÙù]/gu, "u")
.replace(/[ŸÿÝý]/u, "y") .replace(/[ŸÿÝý]/gu, "y")
.replace(/[^a-z0-9- ]/iu, "") .toLowerCase()
.replace(/[^a-z0-9- ]/gu, "")
.trim() .trim()
.replace(/ /iu, "-") .replace(/ /gu, "-");
.toLowerCase();
} }
export function randomInt(min: number, max: number) { export function randomInt(min: number, max: number) {