diff options
author | Martin Fischer <martin@push-f.com> | 2021-12-10 19:45:52 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-12-10 19:45:52 +0100 |
commit | 251ea5cec9f382f82db0c02ba1704031ef279b43 (patch) | |
tree | abc3dff3f4805404be372a665b5df7caf28ee0ae | |
parent | 950ab4cba9cc05b5446aaf889568cfc270d2139c (diff) |
search: don't set href if there's no url
-rw-r--r-- | script.js | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |