mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Fix some path normalization on windows
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user