diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-01-13 16:21:52 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-01-13 16:21:52 +0100 |
commit | 2d0784440ce3eba2225b7d55ed797028eb62459b (patch) | |
tree | 5c22bc381fede35874d19e26fb13fde65936d25e /lib/utils/page.js | |
parent | 7ea236981098f287dab5fa84c1e471217e414af7 (diff) | |
download | gitbook-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.js | 5 |
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]) { |