« get me outta code hell

linkTemplate: encodeURI pre-formed hrefs - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-07-16 12:07:40 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-07-16 12:07:40 -0300
commitb99b524fdffbe72513ac7bfab6308c41d28154d6 (patch)
tree838edf6465926fb3030ed31af00e2823fe2f8f17 /src/content
parentd278cc4537b247dbfb3ccf806b5065e1642c8cb4 (diff)
linkTemplate: encodeURI pre-formed hrefs
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/linkTemplate.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/content/dependencies/linkTemplate.js b/src/content/dependencies/linkTemplate.js
index 98e2c8b9..dab81ad3 100644
--- a/src/content/dependencies/linkTemplate.js
+++ b/src/content/dependencies/linkTemplate.js
@@ -29,7 +29,9 @@ export default {
     let style;
     let title;
 
-    if (!href && !empty(slots.path)) {
+    if (href) {
+      href = encodeURI(href);
+    } else if (!empty(slots.path)) {
       href = to(...slots.path);
     }