summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-12-10 19:45:52 +0100
committerMartin Fischer <martin@push-f.com>2021-12-10 19:45:52 +0100
commit251ea5cec9f382f82db0c02ba1704031ef279b43 (patch)
treeabc3dff3f4805404be372a665b5df7caf28ee0ae
parent950ab4cba9cc05b5446aaf889568cfc270d2139c (diff)
search: don't set href if there's no url
-rw-r--r--script.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/script.js b/script.js
index 1edfa13..2a0c473 100644
--- a/script.js
+++ b/script.js
@@ -71,7 +71,8 @@ function renderList(results) {
const a = document.createElement('a');
a.textContent = feat.title;
a.innerHTML = a.innerHTML.replaceAll(/`(.+?)`/g, (_, x) => `<code>${x}</code>`);
- a.href = feat.url;
+ if (feat.url)
+ a.href = feat.url;
if (feat.flag)
a.title = feat.flag;
li.appendChild(a);