Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Fork of markdown-it-imsize
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Postal Owl
Fork of markdown-it-imsize
Commits
74db2d47
Commit
74db2d47
authored
10 years ago
by
Tatsuya Yatagawa
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
d3ddaa59
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+41
-3
41 additions, 3 deletions
README.md
with
41 additions
and
3 deletions
README.md
+
41
−
3
View file @
74db2d47
...
...
@@ -27,10 +27,10 @@ var md = require('markdown-it')({
is interpreted as
```
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
...
...
@@ -43,3 +43,41 @@ var md = require('markdown-it')({
```
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;
});
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment