summaryrefslogtreecommitdiffstats
path: root/lib/utils/page.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-01-13 16:21:52 +0100
committerSamy Pessé <samypesse@gmail.com>2016-01-13 16:21:52 +0100
commit2d0784440ce3eba2225b7d55ed797028eb62459b (patch)
tree5c22bc381fede35874d19e26fb13fde65936d25e /lib/utils/page.js
parent7ea236981098f287dab5fa84c1e471217e414af7 (diff)
downloadgitbook-2d0784440ce3eba2225b7d55ed797028eb62459b.zip
gitbook-2d0784440ce3eba2225b7d55ed797028eb62459b.tar.gz
gitbook-2d0784440ce3eba2225b7d55ed797028eb62459b.tar.bz2
Fix support for encoded entities in filename
Diffstat (limited to 'lib/utils/page.js')
-rw-r--r--lib/utils/page.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/utils/page.js b/lib/utils/page.js
index 0636ce8..010d703 100644
--- a/lib/utils/page.js
+++ b/lib/utils/page.js
@@ -205,9 +205,12 @@ function normalizeHtml(src, options) {
// Keep it as it is
} else if (links.isRelative(href)) {
var parts = url.parse(href);
- var absolutePath = links.join(options.base, parts.pathname);
+
+ var pathName = decodeURIComponent(parts.pathname);
var anchor = parts.hash || '';
+ // Calcul absolute path for this file (without the anchor)
+ var absolutePath = links.join(options.base, pathName);
// If is in navigation relative: transform as content
if (options.navigation[absolutePath]) {