This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@hedgedoc/markdown-it-image-size
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

markdown-it-imsize

A markdown-it plugin for size-specified image markups. This plugin overloads original image renderer of markdown-it. This is a typescript port of https://github.com/tatsy/markdown-it-imsize without the local file system support.

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" alt="test" 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.

Therefore,

![test](image.png)

is interpreted as

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

where image.png is a valid path and its size is 200 x 200.

Package Sidebar

Install

npm i @hedgedoc/markdown-it-image-size

Weekly Downloads

5

Version

2.0.2

License

AGPL-3.0

Unpacked Size

171 kB

Total Files

19

Last publish

Collaborators

  • davidmehren
  • mrdrogdrog