From 93b401ca9f7a78ca285ec6aaa038358b5aec5d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Wed, 25 Nov 2015 11:49:55 +0100 Subject: [PATCH] Add trailing slash to gitbook.state.root, fix value of gitbook.state.bookRoot --- theme/javascript/state.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/javascript/state.js b/theme/javascript/state.js index e384e36ef..ef1eb047e 100644 --- a/theme/javascript/state.js +++ b/theme/javascript/state.js @@ -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;