Add trailing slash to gitbook.state.root, fix value of gitbook.state.bookRoot

This commit is contained in:
Samy Pessé
2015-11-25 11:49:55 +01:00
parent b137d8270a
commit 93b401ca9f
+1 -1
View File
@@ -27,7 +27,7 @@ state.update = function(dom) {
state.root = url.resolve(
location.protocol+'//'+location.host,
path.dirname(path.resolve(location.pathname.replace(/\/$/, '/index.html'), state.basePath))
);
).replace(/\/?$/, '/');
// Absolute root to the language (for multilingual book)
state.bookRoot = state.innerLanguage? url.resolve(state.root, '..') : state.root;