From daa80dc949a8781d6a363340ce586cc6b56d2612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Wed, 24 Feb 2016 14:20:53 +0100 Subject: [PATCH] Fix conrefs loader with filename starting with / --- lib/output/conrefs.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/output/conrefs.js b/lib/output/conrefs.js index af37de8de..e58f836fe 100644 --- a/lib/output/conrefs.js +++ b/lib/output/conrefs.js @@ -5,6 +5,7 @@ var folderOutput = require('./folder'); var Git = require('../utils/git'); var fs = require('../utils/fs'); var pathUtil = require('../utils/path'); +var location = require('../utils/location'); /* Mixin for output to resolve git conrefs @@ -48,10 +49,8 @@ module.exports = function conrefsLoader(Base) { ConrefsLoader.prototype.onResolveTemplate = function(from, to) { // If origin is in the book, we enforce result file to be in the book if (this.book.isInBook(from)) { - return this.book.resolve( - this.book.relative(path.dirname(from)), - to - ); + var href = location.toAbsolute(to, path.dirname(from), ''); + return this.book.resolve(href); } // If origin is in a git repository, we resolve file in the git repository