Skip to content

Commit 46687ac

Browse files
authored
Merge pull request #118 from webdoc-labs/fix/win-paths
fix: #99
2 parents 4b91fa3 + da15571 commit 46687ac

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

packages/webdoc-template-library/src/SymbolLinks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ const createLink = (doc: any) => {
286286
}
287287
}
288288
289-
return encodeURI(filename || "") + fragmentHash(fragment);
289+
return (filename || "") + fragmentHash(fragment);
290290
};
291291
292292
/**

packages/webdoc-template-library/src/template-plugins/LinkerPlugin.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ function LinkerPluginShell() {
355355
}
356356

357357
getResourceURI(subpath: string): string {
358-
return this.processInternalURI(encodeURI(path.join("/<siteRoot>", subpath)));
358+
return this.processInternalURI(path.join("/<siteRoot>", subpath));
359359
}
360360

361361
createURI(preferredUri: string, outputRelative?: boolean): string {
@@ -374,15 +374,12 @@ function LinkerPluginShell() {
374374
* @return {string} uri with siteRoot
375375
*/
376376
processInternalURI(uri: string, options: { outputRelative?: boolean } = {}): string {
377-
if (!options.outputRelative) {
378-
uri = uri
379-
.replace("%3CsiteRoot%3E", this.siteRoot)
380-
.replace("//", "/");// needed if siteRoot = "";
381-
} else {
382-
uri = uri.replace("/%3CsiteRoot%3E/", "");
383-
}
384-
385-
return uri;
377+
return uri
378+
.replace(
379+
/<siteRoot>/g,
380+
options.outputRelative ? "" : this.siteRoot,
381+
)
382+
.replace(/\/+/g, "/");
386383
}
387384

388385
/**
@@ -445,7 +442,7 @@ function LinkerPluginShell() {
445442
}
446443
}
447444

448-
return encodeURI(probeURI);
445+
return probeURI;
449446
}
450447

451448
/**

0 commit comments

Comments
 (0)