]> git.cworth.org Git - zombocom-ai/blobdiff - index.html
Add support for an image that contains a link
[zombocom-ai] / index.html
index fe30cc65f11171a521888cdefdf0eb6807671d30..92e115ede8e264b75a77843e21cf39ebbd5aff7f 100644 (file)
@@ -176,7 +176,15 @@ mute.addEventListener("click", () => {
 
         const img = document.createElement('img');
         img.src = image.filename;
-        figure.appendChild(img);
+
+        if (image.link) {
+            const a = document.createElement('a');
+            a.href = image.link;
+            a.appendChild(img);
+            figure.appendChild(a);
+        } else {
+            figure.appendChild(img);
+        }
 
         if (image.censored) {
             img.style.display = "none";