Skip to content

Simple marked renderer to include image attributes in markdown. Also generates vimeo links.

License

Notifications You must be signed in to change notification settings

Kamoris/marked-images

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

marked-images

Simple marked renderer to include image attributes in markdown. Also generates vimeo links.

installation

npm install marked-images

usage

var marked = require('marked');
var renderer = new marked.Renderer();

require('marked-images')(renderer);    // monkey-patches the renderer

var html = marked(markdown, {renderer:renderer});

simple width and height

{number}x{number} in the title text part of the link in quotes after the url e.g.

![](src "1x2 title text")
or
![](src "title text 1x2")

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.

![](src "width=1 height=2 align=right title text")

generates:

<img src="src" alt="" width="1" height="2" align="right" title="title text">

vimeo link

start src with 'vimeo/' e.g.

![](vimeo/00000000 "500x281")

generates:

<iframe src="//player.vimeo.com/video/00000000" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen width="500" height="281"></iframe>

About

Simple marked renderer to include image attributes in markdown. Also generates vimeo links.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%