diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-03-28 07:34:20 -0300 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-03-28 07:34:20 -0300 |
| commit | ad012a8297f38eb66cf5e5253c0323353956e9a8 (patch) | |
| tree | c923fab1def914387922b9e437e32577d88c91cd | |
| parent | 3008759e99fc8e2031980e6a4de6f74691938fd7 (diff) | |
content: linkExternal: fix decoding spaces etc
| -rw-r--r-- | src/content/dependencies/linkExternal.js | 5 |
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; } |