Skip to content
Snippets Groups Projects
Commit 74db2d47 authored by Tatsuya Yatagawa's avatar Tatsuya Yatagawa
Browse files

Update README.md

parent d3ddaa59
Branches
No related tags found
No related merge requests found
...@@ -27,10 +27,10 @@ var md = require('markdown-it')({ ...@@ -27,10 +27,10 @@ var md = require('markdown-it')({
is interpreted as is interpreted as
```html ```html
<p><img src="image.png" width="100" height="200"></p> <p><img src="image.png" alt="test" width="100" height="200"></p>
``` ```
### Options ## Options
#### Auto fill #### Auto fill
...@@ -43,3 +43,41 @@ var md = require('markdown-it')({ ...@@ -43,3 +43,41 @@ var md = require('markdown-it')({
``` ```
will fill the width and height fields automatically if the specified image path is valid. will fill the width and height fields automatically if the specified image path is valid.
Therefore,
```js
![test](image.png)
```
is interpreted as
```html
<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
```markdown-it-imsize``` is available with bower and RequireJS. First, you can install the package with,
```shell
bower install markdown-it-imsize
```
Script for using ```markdown-it-imsize``` with RequireJS is as follows.
```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](test.jpg =100x)");
console.log(rendered);
document.getElementById('image-box').innerHTML = rendered;
});
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment