Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Embed External Content #56

Closed
trieloff opened this issue Sep 27, 2018 · 0 comments
Closed

Embed External Content #56

trieloff opened this issue Sep 27, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@trieloff
Copy link
Contributor

trieloff commented Sep 27, 2018

In order to support embeds (OEmbed and Twitter cards, etc.), I suggest following approach:

In the first step, detect embeds and create embed nodes in the MDAST. embeds can take multiple forms:

  1. Gatsby-style: `video: https://www.youtube.com/embed/2Xc9gXyf2G4`
  2. Link + Image-style: [![Audi R8](http://img.youtube.com/vi/KOxbO0EI4MA/0.jpg)](https://www.youtube.com/watch?v=KOxbO0EI4MA "Audi R8")
  3. Link-style: ![](https://www.youtube.com/watch?v=KOxbO0EI4MA)
  4. iA-Writer-Style: https://www.youtube.com/watch?v=KOxbO0EI4MA (the URL is the only content of a paragraph)

The embed node will simply take the previous nodes as children, so that normal HTML processing just skips over it.

In the second step, we add a default handler to the #53 VDOM Util, which finds embed nodes in MDAST and outputs the appropriate HTML to embed the referenced content. The handler uses a service (with configurable URL) for generating appropriate HTML representations.

@trieloff trieloff added the enhancement New feature or request label Sep 27, 2018
@trieloff trieloff mentioned this issue Oct 11, 2018
3 tasks
trieloff added a commit that referenced this issue Nov 2, 2018
Detect embeds, partial implementation of #56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant