adam-p / markdown-here

Google Chrome, Firefox, and Thunderbird extension that lets you write email in Markdown and render it before sending.
https://markdown-here.com
MIT License
59.65k stars 11.26k forks source link

Multimedia? #349

Open eemantsal opened 8 years ago

eemantsal commented 8 years ago

Excuse if I'm asking a too elementary question, I don't know much of Markdown. Can be audio and video files be embedded using Markdown-here? AFAIK images can, but what about voice notes, GIF or MNG animations, or videos? With Evernote you can do all this, but I think they use HTML; well, could the same results be achieved with Markdown to compose mails or notes with multimedia content?

Regards.

ErichDonGubler commented 8 years ago

The short answer is: links and images are fine, but maybe not other types of media. MDH is mainly geared towards writing Markdown in mail clients, so if you want anything other than images (including GIFs) you may just be stuck using links or attachments.

Markdown is basically a convenient notation that relate to commonly-used HTML (lists, blockquotes, etc.). You mentioned Evernote -- Evernote has its own storage and method of presenting rich media like audio and video using HTML. Most mail clients restrict the set of HTML you can use for security reasons, however. If you can't write it in HTML on your mail clients, then you probably can't do it with MDH. If you wrote this in most of them:

![some gif](http://i.imgur.com/7wjjB5a.gif)

...you'd get this:

some gif

...which is really just some human-readable Markdown converted to an img tag. So, theoretically, GIFs should work for MDH. It's not so simple for video and audio, though. Using YouTube as an example, if I were to write a web page with a Youtube embed the element I'd use might be an iframe like this:

<iframe src="//www.youtube-nocookie.com/embed/uzjFEMmM0Xs?rel=0" frameborder="0" allowfullscreen></iframe>

If you write HTML and run it through a Markdown parser, the general expectation is that it returns the HTML. In the case of Markdown Here, you need to write the HTML text in your editor first and THEN use MDH to convert it so that it renders properly. If you have a method of embedding video (Youtube embeds) or audio (links?), you write them as raw text and then use MDH to put them in as HTML.

But iframe usage is dependent on the platform you're using. I used that embed on a post I wrote for my personal website, but _Github and Gmail don't allow iframes for security reasons_ below. When I paste that snippet in this post, nothing gets rendered.

Likewise, when I try to paste an iframe into Gmail and use MDH to render, it seemingly disappears because Gmail refuses to render them for the same reason. For those cases, I would usually just use a link like:

http://www.youtube-nocookie.com/embed/uzjFEMmM0Xs?rel=0

To summarize, you're limited by your client. Does that answer your question?