diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-09-05 20:32:13 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-09-05 20:56:07 -0300 |
commit | 0ff743b1350b1d42ba23d9701a0b7acfb7501254 (patch) | |
tree | a39e7c0cb1ce939a808e325b856d080ab63c8fa4 /src | |
parent | aea700dc531b5183ad20c6fcbf8643aef3f102df (diff) |
content: linkTemplate: handle null href w/ hash cleanly
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/linkTemplate.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/content/dependencies/linkTemplate.js b/src/content/dependencies/linkTemplate.js index 1cf64c59..ba7c7cda 100644 --- a/src/content/dependencies/linkTemplate.js +++ b/src/content/dependencies/linkTemplate.js @@ -29,14 +29,16 @@ export default { language, to, }) { - let href = slots.href; + let href; let style; let title; - if (href) { - href = encodeURI(href); + if (slots.href) { + href = encodeURI(slots.href); } else if (!empty(slots.path)) { href = to(...slots.path); + } else { + href = ''; } if (appendIndexHTML) { |