diff --git a/lib/tocify.js b/lib/tocify.js index f36abbd..b9fa6a7 100644 --- a/lib/tocify.js +++ b/lib/tocify.js @@ -2,7 +2,7 @@ /* eslint-disable no-cond-assign */ const marked = require('marked') -const normalize = require('path').normalize +const path = require('path') const stripMarkdown = require('./helpers/strip_markdown') const assign = Object.assign @@ -216,8 +216,8 @@ function anchorize (source) { */ function absolutify (source, root) { - if (source.substr(0, 1) !== '/') { - source = normalize(root + '/' + source) + if (source.substr(0, 1) !== path.sep) { + source = path.normalize(path.join(root, source)) } source = source.replace(/^\//, '') return { source }