summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/page/index.js2
-rw-r--r--lib/utils/location.js7
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/page/index.js b/lib/page/index.js
index 2dcf704..f3a8f39 100644
--- a/lib/page/index.js
+++ b/lib/page/index.js
@@ -30,7 +30,7 @@ function Page(book, filename) {
this.description = '';
// Relative path to the page
- this.path = filename;
+ this.path = location.normalize(filename);
// Absolute path to the page
this.rawPath = this.book.resolve(filename);
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));