Home

Awesome

markdown-it-images-preview

A markdown-it plugin to preview local images.

Install

npm install markdown-it-images-preview --save

Use

var md = require('markdown-it')();
var miip = require('markdown-it-images-preview');
md.use(miip);

how to add image:

md.image_add('./123', file_binary);
// file_binary = "data:image/png;base64,iVBORw0KGgoA......"

how to preview image:

md.render('![image](./123)');

how to delete image:

md.image_del('./123');