mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
fix toc by sharing slugify()
This commit is contained in:
6
browser/lib/slugify.js
Normal file
6
browser/lib/slugify.js
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = function slugify (title) {
|
||||
return encodeURI(title.trim()
|
||||
.replace(/[\]\[\!\"\#\$\%\&\'\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~]/g, '')
|
||||
.replace(/\s+/g, '-'))
|
||||
.replace(/\-+$/, '')
|
||||
}
|
||||
Reference in New Issue
Block a user