mirror of
https://github.com/BoostIo/Boostnote
synced 2026-05-26 09:22:05 +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