Fix calcul of root in gitbook.state when serving index.html as /

This commit is contained in:
Samy Pessé
2015-10-27 18:44:04 +01:00
parent 6ab386ae35
commit 7a4c6bc326
+1 -1
View File
@@ -23,7 +23,7 @@ state.update = function(dom) {
// Absolute url to the root of the book
state.root = url.resolve(
location.protocol+'//'+location.host,
path.dirname(path.resolve(location.pathname, state.basePath))
path.dirname(path.resolve(location.pathname.replace(/\/$/, '/index.html'), state.basePath))
);
};