mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
7 lines
214 B
JavaScript
7 lines
214 B
JavaScript
module.exports = function slugify (title) {
|
|
return encodeURI(title.trim()
|
|
.replace(/[\]\[\!\"\#\$\%\&\'\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~]/g, '')
|
|
.replace(/\s+/g, '-'))
|
|
.replace(/\-+$/, '')
|
|
}
|