Skip to content

Commit 491edbb

Browse files
committedNov 9, 2015
Join the path as a file path with path.join
The path is not a url so the hard coded separator / should not be used. Its still file paths even if its .html files. path.join is used to join the dir and the file.
1 parent 2ad15cc commit 491edbb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎lib/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var basename = require('path').basename;
33
var debug = require('debug')('metalsmith-markdown');
44
var dirname = require('path').dirname;
55
var extname = require('path').extname;
6+
var join = require('path').join;
67
var marked = require('marked');
78

89
/**
@@ -31,7 +32,7 @@ function plugin(options){
3132
var data = files[file];
3233
var dir = dirname(file);
3334
var html = basename(file, extname(file)) + '.html';
34-
if ('.' != dir) html = dir.replace(/\\/g, '/') + '/' + html;
35+
if ('.' != dir) html = join(dir, html);
3536

3637
debug('converting file: %s', file);
3738
var str = marked(data.contents.toString(), options);

0 commit comments

Comments
 (0)
Please sign in to comment.