webpro / reveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file
MIT License
3.74k stars 416 forks source link

Support Reveal's Lazy Loading #443

Open thewellington opened 1 year ago

thewellington commented 1 year ago

I would like to see support for Lazy Loading of all the objects that reveal.js can lazily load. Currently this requires changing the src attribute of the media object you are looking for to data-src to prevent the browser from loading the media immediately upon page load. For example:

<img src="my image.jpg" /> would be changed to <img data-src="my image.jpg" />

Then as the presentation approaches the slide in question the media is loaded and ready for display when the slide is displayed.

Currently reveal-md cannot do this (at least not as far as I can find documented) presumably because the markdown processor looks at [My Image](my image.jpg) and makes <img src="my image.jpg" />

What can be done to change this behavior and give us lazy loading?

webpro commented 1 year ago

If anyone's up to look into it and submit a PR, I'm happy to look into that.