Skip to content

Commit

Permalink
Narrow down lightbox to just image embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
kepano committed May 7, 2024
1 parent 3807654 commit 2c3e25b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 2c3e25b

Please sign in to comment.