WangZixian fecfac1207 TEXT 10 сар өмнө
..
coverage fecfac1207 TEXT 10 сар өмнө
dist fecfac1207 TEXT 10 сар өмнө
lib fecfac1207 TEXT 10 сар өмнө
test fecfac1207 TEXT 10 сар өмнө
.coveralls.yml fecfac1207 TEXT 10 сар өмнө
.eslintignore fecfac1207 TEXT 10 сар өмнө
.eslintrc fecfac1207 TEXT 10 сар өмнө
.npmignore fecfac1207 TEXT 10 сар өмнө
.travis.yml fecfac1207 TEXT 10 сар өмнө
Makefile fecfac1207 TEXT 10 сар өмнө
README.md fecfac1207 TEXT 10 сар өмнө
bower.json fecfac1207 TEXT 10 сар өмнө
package.json fecfac1207 TEXT 10 сар өмнө
webpack.config.js fecfac1207 TEXT 10 сар өмнө

README.md

markdown-it-imsize

Build Status NPM version Coverage Status Dependency Status devDependency 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" 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.

Use with RequireJS


shell bower install markdown-it-imsize


Script for using ```markdown-it-imsize``` with RequireJS is like,

js require(['require', 'MarkdownIt', 'MarkdownItImsize'], function(require) { var md = require('MarkdownIt')({

html: true,
linkify: true,
typography: true

}).use(require('MarkdownItImsize'));

var rendered = md.render("test"); document.getElementById('image-box').innerHTML = rendered; }); ```