markdown-js
markdown-js copied to clipboard
how to render a youtube link
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.
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.