summaryrefslogtreecommitdiffstats
path: root/lib/generate/site/index.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-11-12 19:06:33 +0100
committerSamy Pessé <samypesse@gmail.com>2014-11-12 19:06:33 +0100
commitb90f74a8210b8939a78ba9664198dce2a2f902f6 (patch)
tree8b6a93e82c9820083fa9be045d297d72403d48d0 /lib/generate/site/index.js
parentf804eb42acdb56405e42583d216f8289428d8fb1 (diff)
parenta741ec13501705e78e2825c593772f1bdb663a43 (diff)
downloadgitbook-b90f74a8210b8939a78ba9664198dce2a2f902f6.zip
gitbook-b90f74a8210b8939a78ba9664198dce2a2f902f6.tar.gz
gitbook-b90f74a8210b8939a78ba9664198dce2a2f902f6.tar.bz2
Merge pull request #494 from cnDelbert/master
Bug fix for issue#493: 2-level or more deep relative links go wrong when in win32
Diffstat (limited to 'lib/generate/site/index.js')
-rw-r--r--lib/generate/site/index.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js
index f0a4780..4d8803e 100644
--- a/lib/generate/site/index.js
+++ b/lib/generate/site/index.js
@@ -154,7 +154,12 @@ Generator.prototype.convertFile = function(content, _input) {
if (_output == "README.html") _output = "index.html";
var output = path.join(this.options.output, _output);
var basePath = path.relative(path.dirname(output), this.options.output) || ".";
-
+
+ // Bug fix for issue #493 which would occur when relative-links are 2-level or more deep in win32
+ if (process.platform === 'win32') {
+ basePath = basePath.replace(/\\/g, '/');
+ }
+
return this.prepareFile(content, _input)
.then(function(page) {
// Index page in search