diff options
author | Jeffrey Tse <jeffreytse.mail@gmail.com> | 2023-08-26 11:02:04 +0800 |
---|---|---|
committer | Jeffrey Tse <jeffreytse.mail@gmail.com> | 2023-08-26 16:25:41 +0800 |
commit | 300f0cb0dcde6ee467f236125c2ea9cda7671d62 (patch) | |
tree | 925ab1f4c97f387f48eece9cd1cfd69de18f0ee5 /_includes/extensions/photo-swipe.html | |
parent | d3397dcfcea3cb07f7c3f0ccac57f466a2977167 (diff) |
feat: auto ignore invalid images
Diffstat (limited to '_includes/extensions/photo-swipe.html')
-rw-r--r-- | _includes/extensions/photo-swipe.html | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |