Skip to content

Commit

Permalink
fix: slugify parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
phvm committed Oct 28, 2024
1 parent 7038f96 commit 94b64cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/string-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ export const toCamelCase = (str: string) => {
export const slugify = (str: string) => {
return str
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.replace(/\s+/g, '-')
.replace(/\-+/g, '-')
.replace(/[^a-z0-9\-]/g, '')
}

type Child = string | { props: { children: Child[] } }
Expand Down

0 comments on commit 94b64cc

Please sign in to comment.