https://github.com/junwatu/markdown-it-lazy-loading
markdown-it plugin that add awesome loading="lazy" attribute to img or iframe tag.
https://github.com/junwatu/markdown-it-lazy-loading
lazy-loading markdown-it markdown-it-lazy-loading markdown-it-plugin
Last synced: 3 months ago
JSON representation
markdown-it plugin that add awesome loading="lazy" attribute to img or iframe tag.
- Host: GitHub
- URL: https://github.com/junwatu/markdown-it-lazy-loading
- Owner: junwatu
- License: mit
- Created: 2020-10-27T02:20:48.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-30T01:56:37.000Z (over 5 years ago)
- Last Synced: 2025-10-05T13:02:27.533Z (7 months ago)
- Topics: lazy-loading, markdown-it, markdown-it-lazy-loading, markdown-it-plugin
- Language: JavaScript
- Homepage:
- Size: 72.3 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-lazy-loading
 
This is a plugin for the [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser.
This plugin add `loading="lazy"` attribute to `img` or `iframe` tag.
Install
---
```powershell
npm install @junwatu/markdown-it-lazy-loading --save-dev
```
## How to use
Add `lazy` loading attribute to `img` tag.
```javascript
const MarkdownIt = require("markdown-it");
const markdownItLazyLoading = require("@junwatu/markdown-it-lazy-loading");
const mdText = "";
const lzAttr = { img: "lazy" };
const md = MarkdownIt().use(markdownItLazyLoading, lzAttr);
console.log(md.render(mdText));
//
Hello
```
---
MIT (c) 2020