@mdit/plugin-img-lazyload
Plugin to add lazy loading for images.
Usage
@tab TS
import MarkdownIt from "markdown-it";
import { imgLazyload } from "@mdit/plugin-img-lazyload";
const mdIt = MarkdownIt().use(imgLazyload);
mdIt.render("");Description
The plugin automatically add loading="lazy" to all images to let them being lazy loaded.
Note
This is a native HTML5 feature, so your browser must support loading=lazy attribute.