From 2c3e25b35ddb2d8c7e6ae1599d438d04e4321e77 Mon Sep 17 00:00:00 2001 From: Steph Ango <10565871+kepano@users.noreply.github.com> Date: Tue, 7 May 2024 12:47:41 -0700 Subject: [PATCH] Narrow down lightbox to just image embeds --- publish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish.js b/publish.js index a0f3331..a067a86 100644 --- a/publish.js +++ b/publish.js @@ -29,7 +29,7 @@ function updateCurrentPath() { publish.registerMarkdownPostProcessor(async (el, ctx) => { updateCurrentPath(); - const blockImages = Array.from(el.querySelectorAll('.internal-embed')); + const blockImages = Array.from(el.querySelectorAll('.internal-embed')).filter(span => /\.(jpg|jpeg|png|gif|bmp|svg)$/i.test(span.getAttribute('src'))); blockImages.forEach((span) => { if (!span.classList.contains('processed')) { span.classList.add('processed');