3.1.0 • Published 10 months ago
marked-images v3.1.0
marked-images
Simple marked renderer to include image attributes in markdown. Also generates vimeo links.
installation
npm install marked-images
usage
NOTE: breaking changes:
- As of v2.0.0, this library uses the
marked.use()
plugin api. - As of v3.0.0, since marked v4.x the
marked()
function is no longer the default export. CommonJS code which doesmarked = require(marked)
should be changed to callmarked.marked(<markdown-string>)
instead ofmarked()
.
var marked = require('marked');
var markedImages = require('marked-images');
// opts are optional
var opts = {
xhtml: false,
fqImages: { route: '/images/', url:'https://images.example.com' }, // use custom image endpoint url when link starts with route
fqLinks: 'https://www.example.com', // generate fully qualified links if fqImages is not set
relPath: false
}
marked.use(markedImages(opts));
var html = marked.marked(markdown);
simple width and height
{number}x{number} in the title text part of the link in quotes after the url e.g.

or

generates:
<img src="src" alt="" width="1" height="2" title="title text">
explicit attributes
any attribute name=value, no quotes around the value e.g.

generates:
<img src="src" alt="" width="1" height="2" align="right" title="title text">
CSS classnames
.{classname}

generates:
<iframe src="//player.vimeo.com/video/00000000" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen width="500" height="281"></iframe>
3.1.0
10 months ago
3.0.2
2 years ago
3.0.1
3 years ago
3.0.0
3 years ago
2.4.0
4 years ago
2.3.0
4 years ago
2.2.1
5 years ago
2.2.0
5 years ago
2.1.1
5 years ago
2.1.0
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.4.0
5 years ago
1.3.1
5 years ago
1.3.0
6 years ago
1.2.5
6 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
10 years ago
1.2.0
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.0
10 years ago
0.5.0
10 years ago