-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Add Embed extension #805
Add Embed extension #805
Conversation
482534d
to
60f2671
Compare
I honestly think directly parsing the URLs might be a really bad idea. sometimes you just want put a URL in the text. I think the old proposal was on correct track as this is not a standard, i think you may even go further by using specific tags. like
as such you dont have to parse the whole body and user get to choose if they want make it embeddable or something else, this extension could as well put the two functionality and let the user choose. and the domains should be extendable, for self hosted etc. Violates the spirit of OEmbedThis might be applicable if you have some sort of URL textbox specific for URLs. However markdown usually used in text area with many many different text some which might look like a URL. In this case i dont think it's applicable. Thank you. |
I like limiting the embeds to standalone links and ignoring them in any other elements like inline with text. I'm not sure if users would simultaneously want to embed stuff, but also show text links as separate blocks in the same document. I'd probably put the link in something like a blockquote, if I want to emphasize the link itself in such cases. I also follow the argument of not using any additional syntax (like image embeds) for this. This is comparable to the autolink extension for me, in that deactivating the extension still renders a perfectly fine document without extension-specific artifacts. Looking forward to this extension 🙂 |
This Embed extension will only attempt to embed URLs that:
Normally these URLs would be rendered as plain text (unless you use the Autolink extension). If the given URL does not contain embeddable content, it will be rendered as a normal link instead (just like how Autolink would handle it). And lastly, users would have to opt-in to using this extension - it would not be enabled by default. If somebody does enable this and they still want to place a URL on its own line without embedding it, they could use the
Yep, that's exactly right. You could nest it in a blockquote, wrap it with emphasis ( |
Will there be a way to "disable" this behavior / keep the old style? All the best; |
Yes, this is an optional extension which will not be enabled by default. Only users who explicitly add and configure this additional extension will get this behavior. |
60f2671
to
aeaf122
Compare
Implements the ability to easily embed rich content from other websites via OEmbed and other such APIs.
Syntax
The syntax for using this extension is straight-forward - just drop a link on its own line anywhere in the Markdown document:
Check out this video! https://www.youtube.com/watch?v=dQw4w9WgXcQ
More details about the syntax and usage of the extension can be found in the proposed documentation for this extension.
Previously Proposed Syntax
I initially proposed reusing the image syntax for this feature:
But on further reflection this had some significant downsides:
Performance
It would be impossible to differentiate between an image and an embeddable resource without making an HTTP request each time image-like syntax appeared. Even if we managed to make those calls in parallel, it still requires extra wasted overhead.
Violates the spirit of Markdown
As John Gruber said:
Violates the spirit of OEmbed
The whole point of OEmbed is that users simply drop a link somewhere:
The experience should be seamless, just like it is when posting URLs on Twitter, Slack, etc.
Feedback Wanted
Any/all feedback on this feature would be greatly appreciated!
(Closes #740)