diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-25 19:15:47 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-25 19:15:47 +0100 |
commit | 80718cc783fae9677dde8bb95cce7db3362db978 (patch) | |
tree | 703992775883eda094dff4cb867afd71f436b6fa /lib/utils | |
parent | 73f22332ec095ec95518d7708cbeeb3db4a88655 (diff) | |
download | gitbook-80718cc783fae9677dde8bb95cce7db3362db978.zip gitbook-80718cc783fae9677dde8bb95cce7db3362db978.tar.gz gitbook-80718cc783fae9677dde8bb95cce7db3362db978.tar.bz2 |
Fix some path normalization on windows
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/location.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/utils/location.js b/lib/utils/location.js index d96cf85..ba0c57d 100644 --- a/lib/utils/location.js +++ b/lib/utils/location.js @@ -34,9 +34,12 @@ function normalize(s) { // dir: directory parent of the file currently in rendering process // outdir: directory parent from the html output function toAbsolute(_href, dir, outdir) { - outdir = outdir == undefined? dir : outdir; - if (isExternal(_href)) return _href; + outdir = outdir == undefined? dir : outdir; + + _href = normalize(_href); + dir = normalize(dir); + outdir = normalize(outdir); // Path "_href" inside the base folder var hrefInRoot = path.normalize(path.join(dir, _href)); |