From 300f0cb0dcde6ee467f236125c2ea9cda7671d62 Mon Sep 17 00:00:00 2001 From: Jeffrey Tse Date: Sat, 26 Aug 2023 11:02:04 +0800 Subject: feat: auto ignore invalid images --- _includes/extensions/photo-swipe.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_includes/extensions/photo-swipe.html b/_includes/extensions/photo-swipe.html index 9985954..fb3ee7a 100644 --- a/_includes/extensions/photo-swipe.html +++ b/_includes/extensions/photo-swipe.html @@ -43,6 +43,9 @@ const imgEls = []; const els = galleryEl.querySelectorAll("img:not(.emoji)"); els.forEach((el) => { + if (el.src.trim() == "") { + return; + } if (!imgEls.includes(el)) { imgEls.push(el); } -- cgit v1.2.3