mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
support oEmbed media embedding #211
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @damageboy on GitHub (May 25, 2018).
markdig currently supports a very specific list of media embedding as described in:
https://github.com/lunet-io/markdig/blob/master/src/Markdig.Tests/Specs/MediaSpecs.md
I was wondering if there was ever serious consideration of implementing an oEmbed client inside markdig and support embedding of foreign content in a more generalized way...
There seems to be a very full functional client called embedo which does all the magic, in theroy of embedding various 3rd part contents inside existing html.
Would using embedo (as in generating embedo code on the generated html) be something markdig devs would accept as a PR?
If not, would implementing oEmbed calls be something that markdig devs would be willing to incorporate?
From what I see there a various embedding "specs" to consider:
http://oembed.com/
http://ogp.me/
https://dev.twitter.com/cards/overview
@xoofx commented on GitHub (May 25, 2018):
Do you have a simple example how this would be integrated in markdig, what kind of output it would produce?...etc. (sorry, don't have time to read all the specs, just looking for a high level view of the usage/results 😅 )
@damageboy commented on GitHub (May 26, 2018):
Sure... Let's take oEmbed for youtube's case:
Vidoe:
https://www.youtube.com/watch?v=M3r2XDceM6A
That video, in it's html
<head>has the following<link>:Folowing that link (either during HTML rendering or markdown, or by embedding JS libs like embedo
would retrieve the following json:
The json basically provides enough data/metadata to do the youtube embedding of the video...
Is that the sort of description you had in mind?
@xoofx commented on GitHub (May 28, 2018):
Thanks.
So If I understand it correctly, it would require an extension to perform the download of the JSON, analyze it and output the correct link instead... Is that correct?
If it is the case, I'm fine for an extension to do this, but I would prefer not to integrate this as part of markdig repo as it will require a dependency on HTTP client (not by default on netstandard) and JSON. If you would like this feature, you could develop your own extension of markdig in a separate repo.
@damageboy commented on GitHub (May 29, 2018):
OK, I think I understand your thinking about this.