A markdown-it plugin to add links to images
npm install markdown-it-linkify-images
A markdown-it plugin to add links to images
> Linkifying Images plugin for markdown-it markdown parser.
node.js, browser:
``bash`
npm install markdown-it-linkify-images --save
bower install markdown-it-linkify-images --save
`js`
var md = require('markdown-it')()
var mili = require('markdown-it-linkify-images')
`js
// Basic Use
md.use(mili)
var html = md.render('!the image caption')
html //
`js
// With Custom Configuration
md.use(mili, {
target: '_blank',
linkClass: 'custom-link-class',
imgClass: 'custom-img-class'
})var html = md.render('!the image caption')
html //
`_Differences in browser._ If you load script directly into the page, without a package system, the module will add itself globally as
window.markdownitLinkifyImages`.This plugin is tested against markdown-it @ 6,7,8 and latest