Socket
Socket
Sign inDemoInstall

markdown-it-linkify-images

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-it-linkify-images


Version published
Weekly downloads
922
decreased by-18.77%
Maintainers
1
Install size
950 kB
Created
Weekly downloads
 

Readme

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

FAQs

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc