Skip to content

Commit 967a6fe

Browse files
committed
Fixed slugify
1 parent 2bc4dd5 commit 967a6fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ const slugify = (text, separator) => {
1616
.toString()
1717
.toLowerCase()
1818
.trim()
19+
.replace(/[·/_,:;']/g, '-') // Replace unwanted characters with -
1920
.replace(/\s+/g, '-') // Replace spaces with -
2021
.replace(/&/g, '-and-') // Replace & with 'and'
2122
.replace(/[^\w-]+/g, '') // Remove all non-word chars
2223
.replace(/-+/g, '-') // Replace multiple - with single -
2324
.replace(/^-+/, '') // Trim - from start of text
2425
.replace(/-+$/, '') // Trim - from end of text
25-
.replace(/[·/_,:;']/g, '-') // Replace unwanted characters with -
2626

2727
if (separator && separator !== '-') {
2828
text = text.replace(/-/g, separator)

0 commit comments

Comments
 (0)