Skip to content
Snippets Groups Projects
Select Git revision
  • 68d0ccffc1db8c8229732a22db86e747cf2309bf
  • upstream default protected
  • master
3 results

markdown-it-imsize

user avatar
tatsy authored
68d0ccff
History

markdown-it-imsize

Build Status NPM version Coverage Status

A markdown-it plugin for size-specified image markups. This plugin overloads original image renderer of markdown-it.

Usage

Enable plugin

var md = require('markdown-it')({
  html: true,
  linkify: true,
  typography: true
}).use(require('markdown-it-imsize')); // <-- this use(package_name) is required

Example

![test](image.png =100x200)

is interpreted as

<p><img src="image.png" width="100" height="200"></p>

Options

Auto fill

var md = require('markdown-it')({
  html: true,
  linkify: true,
  typography: true
}).use(require('markdown-it-imsize'), { autofill: true });

will fill the width and height fields automatically if the specified image path is valid.