mkdocs-glightbox icon indicating copy to clipboard operation
mkdocs-glightbox copied to clipboard

Can support for the "data-src" attribute be added?

Open jaywhj opened this issue 2 months ago • 0 comments

Hi, I'm running into a problem where my html structure has data-src (no src), which results in the href tag <a href=""> not having a value and the image not loading when clicked, like this:

<img class="avatar" data-src="https://jaywhj.netlify.app/assets/avatar.png">

I set the src value of this img via JS.

data-src is a custom attribute that complies with the HTML5 specification for data sources.

My questions:

  1. Can image src set dynamically via JS be parsed and loaded? For example, instead of setting the src attribute value directly in html, it is set via JS
  2. If dynamic assignment by JS is not recognized, can support for "data-src" attribute be added?

jaywhj avatar Nov 02 '25 14:11 jaywhj