Lazy image plugin for markdown-it parser, replace 'src' attributes with 'data-src' for use with lazyload.
yarn add markdown-it-lazy-image
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
MIT © h404bi