diff options
Diffstat (limited to 'lib/parse')
-rw-r--r-- | lib/parse/renderer.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/parse/renderer.js b/lib/parse/renderer.js index d0ca597..6b45a22 100644 --- a/lib/parse/renderer.js +++ b/lib/parse/renderer.js @@ -76,10 +76,8 @@ GitBookRenderer.prototype.image = function(href, title, text) { // Relative image, rewrite it depending output if(!parsed.protocol && parsed.path && parsed.path[0] != '/' && o && o.dir && o.outdir) { - _href = path.relative(o.outdir, path.normalize(path.join( - o.dir, - href - ))); + var outdir = o.outdir.charAt(o.outdir.length - 1) === '/' ? o.outdir : o.outdir + '/'; + _href = url.resolve(outdir, [o.dir, href].join('/')); } return GitBookRenderer.super_.prototype.image.call(this, _href, title, text); |