markdown-js icon indicating copy to clipboard operation
markdown-js copied to clipboard

how to render a youtube link

Open ghost opened this issue 11 years ago • 1 comments

I was using showdown.js until recently, but I want to try out markdown-js. Is it possible to render something like this:

^^http://youtube.com/watch?v=somestring

into this:

<iframe  src=//www.youtube.com/embed/somestring?rel=0 frameborder=0 allowfullscreen></iframe>

There is an extension for this on showdown, I am not sure how to extend this parser.

ghost avatar Feb 05 '14 19:02 ghost

To do this you should create a new dialect and then add a new block level matcher which checks for a block starting with ^^. I suggest looking at how the Maruku dialect extends the Gruber dialect for reference.

evilstreak avatar Feb 13 '14 13:02 evilstreak