diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-24 14:20:53 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-24 14:20:53 +0100 |
commit | daa80dc949a8781d6a363340ce586cc6b56d2612 (patch) | |
tree | b56c2304a24b55604df48397ecd080916f2c5ac7 | |
parent | 255a78a534d4d1f9f3f223b717d31c43008e095d (diff) | |
download | gitbook-daa80dc949a8781d6a363340ce586cc6b56d2612.zip gitbook-daa80dc949a8781d6a363340ce586cc6b56d2612.tar.gz gitbook-daa80dc949a8781d6a363340ce586cc6b56d2612.tar.bz2 |
Fix conrefs loader with filename starting with /
-rw-r--r-- | lib/output/conrefs.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/output/conrefs.js b/lib/output/conrefs.js index af37de8..e58f836 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 |