#markdown-it #markdown #lazy-evaluation #plugin #add #tags #image

markdown-it-lazyload

A markdown-it plugin to add lazy to image tags' loading property

2 releases

0.1.1 Jan 1, 2025
0.1.0 Jan 1, 2025

#1688 in Parser implementations

Download history 276/week @ 2025-01-01

276 downloads per month

Apache-2.0

7KB

markdown-it-lazyload

markdown-it-lazyload markdown-it-lazyload

A markdown-it.rs plugin to add lazy to loading property in <img> tag.

Usage

let mut parser = markdown_it::MarkdownIt::new();
markdown_it::plugins::cmark::add(parser);
markdown_it_lazyload::add(parser);

md.parse("![Rust](https://example.com/example.png)").render();
// <p><img src="https://example.com/example.png" alt="Rust" loading="lazy"></p>

See the tests for more examples.

Specification

Dependencies

~5–14MB
~190K SLoC