Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.

Lazy image plugin for markdown-it parser, replace 'src' attributes with 'data-src' for use with lazyload.

License

Notifications You must be signed in to change notification settings

chawyehsu/markdown-it-lazy-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown-it-lazy-image

npm

Lazy image plugin for markdown-it parser, replace 'src' attributes with 'data-src' for use with lazyload.

Install

yarn add markdown-it-lazy-image

Usage

var md = require('markdown-it')();
var lazy_image = require('markdown-it-lazy-image');

md.use(lazy_image [, options]);

md.render(`![](example.png "image title")`);

// returns:
//
//<p><img src="data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=" data-src="example.png" alt title="image title" /></p>

Options are not mandatory:

  • placeholder (String or Url) - replace 'src' attributes with given placeholder

License

MIT © h404bi

Website · GitHub @h404bi · Twitter @h404bi

About

Lazy image plugin for markdown-it parser, replace 'src' attributes with 'data-src' for use with lazyload.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages