Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube video markdown #226

Open
kstubs opened this issue Oct 31, 2014 · 12 comments
Open

YouTube video markdown #226

kstubs opened this issue Oct 31, 2014 · 12 comments

Comments

@kstubs
Copy link

kstubs commented Oct 31, 2014

This works great to produce a link to a YouTube video, but if I want to produce YouTubes embed tag into my html, so basically an iFrame widget, how would I go about doing this? Do I provide a different dialect or function somehow?

markdown.toHTML('[![Bronwyn’s Perfect 10 on Vault](http://img.youtube.com/vi/LVbbC4cmI9I/0.jpg)](http://www.youtube.com/watch?v=LVbbC4cmI9I)')

Produces quite nicely:

<p><a href="http://www.youtube.com/watch?v=LVbbC4cmI9I"><img alt="Bronwyn’s Perfect 10 on Vault" src="http://img.youtube.com/vi/LVbbC4cmI9I/0.jpg"/></a></p>
@jaredatron
Copy link

Markdown does not support YouTube anything but it does support HTML. Just paste the YouTube embed code directly into your document.

@kstubs
Copy link
Author

kstubs commented Oct 31, 2014

Not sure if I'm following you exactly. My challenge is: my document source is a Google Document. Google Documents do not support embeded videos so my solution is to provide the video via markdown code and then parse it on the client. This is working great, I'm just not sure how to add a different markdown output than what is currently being produced: an image that links to youtube video.

@jaredatron
Copy link

I have no idea how to solve your weird google docs thing. But in terms of markdown, markdown supports HTML :)

@kstubs
Copy link
Author

kstubs commented Oct 31, 2014

Lol. Ok forget Google Docs. The real question here is: how can I generate a custom markdown result?

@jaredatron
Copy link

You would have to write your own dialect

@kstubs
Copy link
Author

kstubs commented Oct 31, 2014

Do I provide a different dialect or function somehow?

Lol, how? Can you offer some tips?

@jaredatron
Copy link

  1. read the README.md
  2. read the source code for the existing dialects
  3. write your own.

@grofit
Copy link

grofit commented Dec 4, 2014

I must admit the existing dialects are not the easiest to decipher, a section in the documentation about this would go a long way.

@jaredatron
Copy link

+1

@codingisacopingstrategy

Maybe a simpler example, this a dialect my co-worker made. Writing dialects might not be very straightforward, but it’s easier to do than in most Markdown implementations: https://github.com/aleray/markdown-js/blob/9373b6b4b435aff47ed533f1cf111b9c884d430a/src/dialects/aa.js

Your linked image solution seems a pretty efficient though :)

@ghost
Copy link

ghost commented May 6, 2016

I'm using this in tiddlywiki plugin and I can't achieve to embed vimeo videos. It's supposed that markdown allow html embed, but this library does not:

<figure class="center">
<iframe src="https://player.vimeo.com/video/159057636" width="600" height="337" frameborder="0" allowfullscreen=""></iframe>
<figcaption>
<small>
<p><em><a href="http://www.rtve.es/alacarta/videos/telediario/telediario-15-horas-24-12-15/3421858/">Telediario 15:00</a></em> de TVE1 (24/12/2015). &copy; RTVE 2015 (disponible <a href="/media/content/activities/La-lluna-plena/act3.webm">localment</a>).</p>
</small>
</figcaption>
</figure>

Related to fully support HTML

@bmamouri
Copy link

bmamouri commented Aug 8, 2016

@deadlyicon markdown does support HTML but markdown-js escape HTML tags!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants