« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/linkExternal.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/content/dependencies/linkExternal.js b/src/content/dependencies/linkExternal.js
index 53ff033f..e1393455 100644
--- a/src/content/dependencies/linkExternal.js
+++ b/src/content/dependencies/linkExternal.js
@@ -83,10 +83,11 @@ export default {
     let href;
     if (urlIsValid) {
       const {canonicalBase, canonicalMediaBase} = data;
+      const past = front => decodeURIComponent(url.slice(front.length));
       if (canonicalMediaBase && url.startsWith(canonicalMediaBase)) {
-        href = to('media.path', url.slice(canonicalMediaBase.length));
+        href = to('media.path', past(canonicalMediaBase));
       } else if (canonicalBase && url.startsWith(canonicalBase)) {
-        href = to('shared.path', url.slice(canonicalBase.length));
+        href = to('shared.path', past(canonicalBase));
       } else {
         href = url;
       }