wikijs-fork/client/js/helpers/pages.js

10 lines
246 B
JavaScript
Raw Normal View History

2017-02-09 01:52:37 +00:00
function makeSafePath (rawPath) {
let rawParts = _.split(_.trim(rawPath), '/')
rawParts = _.map(rawParts, (r) => {
return _.kebabCase(_.deburr(_.trim(r)))
})
return _.join(_.filter(rawParts, (r) => { return !_.isEmpty(r) }), '/')
}