🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

markdown-it-linkify-images

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-it-linkify-images

A markdown-it plugin to add links to images

4.0.0
latest
Source
npm
Version published
Weekly downloads
3K
46.69%
Maintainers
1
Weekly downloads
 
Created
Source

markdown-it-linkify-images

Greenkeeper badge A markdown-it plugin to add links to images

Linkifying Images plugin for markdown-it markdown parser.

Install

node.js, browser:

npm install markdown-it-linkify-images --save
bower install markdown-it-linkify-images --save

Use

var md = require('markdown-it')()
var mili = require('markdown-it-linkify-images')
// Basic Use
md.use(mili)

var html = md.render('![the image caption](img/smile.png)')
html // <p><a href="img/smile.png" target="_self"><img src="img/smile.png" alt="the image caption"></a></p>
// With Custom Configuration
md.use(mili, {
  target: '_blank',
  linkClass: 'custom-link-class',
  imgClass: 'custom-img-class'
})

var html = md.render('![the image caption](img/smile.png)')
html // <p><a href="img/smile.png" target="_blank" class="custom-link-class"><img src="img/smile.png" alt="the image caption" class="custom-img-class"></a></p>

Differences in browser. If you load script directly into the page, without a package system, the module will add itself globally as window.markdownitLinkifyImages.

Testing

This plugin is tested against markdown-it @ 6,7,8 and latest

License

MIT

Keywords

markdown-it

FAQs

Package last updated on 20 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts