Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ slugify('some string', '_') // some_string
slugify('some string', {
replacement: '-', // replace spaces with replacement
remove: null, // regex to remove characters
remover: '', // replace remove regex match with remover
lower: true // result in lower case
})
```
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
.reduce(function (result, ch) {
return result + (charMap[ch] || ch)
// allowed
.replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]/g, '')
.replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]/g, options.remover || '')
}, '')
// trim leading/trailing spaces
.trim()
Expand Down