Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/tocify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 }
Expand Down