-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Embed Block: pasting URLs to the WordPress codex tries to embed, fails #4799
Comments
I don't think these are supposed to expand at all, when I checked in the classic editor they do not. I'm not certain what logic determines if the link you paste is treated as an oembed? |
I ran into a similar issue since update to 2.1, consistently with many different website, not just WP Codex/ here is the screen recording: http://recordit.co/ZZDZpJ9gra Message in the Browser Console: Let me know if you need more info to troubleshoot this. :-) |
Even with a URL that works, like a tweet I still get messages in the Browser Console: One of the messages: Let me know what else you would need to troubleshoot this. |
CC: @notnownikki as I recall you working on embeds. |
Will take a look |
Ok, the simpler issue first - the messages you see in the console when you embed Twitter content is because we sandbox the embedded content so it cannot interfere with the editor. They're normal in this content. The other issue is more difficult. Codex URLs cannot be embedded, but the way we deal with pasting URLs assumes that every URL you paste can be embedded. If they can't you end up with an Embed block in an error state. I think there are a couple of ways we could solve this.
or
Option 2 is (probably?) more work, but would be a smoother experience for the user - the UI wouldn't jump about as embed blocks tried and failed to embed unsupported URLs and transformed back, as they would in option 1. cc: @gziolo (as your name is next to the transform 😄 ) |
Unfortunately, this seems to be an unlucky coincidence. I can't help much here as I didn't work with transforms :( |
Thanks a bunch for investigating Nikki, I assumed it was a conflict with the WordPress post embed feature since "wordpress.org" was in the URL. CC: @iseulde as I believe you've worked on pasting, perhaps you can shed light? |
haha ok 😄 Then I'll pick this up and go with option 2 then! |
We are attempting to embed any link and fall back to the error. The plan was to show something for any link when pasting on its own line, through parsing the Open Graph tags (just like Twitter, Facebook etc.) I have a local WIP branch on this actually. I should push it some time. :) |
@notnownikki It's not only the WordPress Codex web pages that throw the error. The example I posted earlier doesn't work. http://www.advancedwp.org/awp-gutenberg-interview-series/ Although if I wanted to share the link on Facebook it pulls in all the relevant information from the OpenGraph - So that idea would be really worth pursuing. :-) Let me know how can help testing/ troubleshooting this. |
Closing because I tested with WordPress 4.9.6 and Gutenberg 3.1.1 and was not able to see the bug happen where an embed block fails with an error for links such as http://codex.wordpress.org/Using_Themes or http://www.advancedwp.org/awp-gutenberg-interview-series/ — in cases where a non-embeddable link is used, the embed block is displays them as simple links.
|
Updating... @iseulde asked me to look at a solution for this that generated a generic preview for pasted URLs that could not be embedded, it's a bit old now and needs rebasing, but it's at #7350 and if you paste an unsupported URL you get an editable paragraph block with the URL in it as a link, and a preview block generated from OpenGraph data. Could do with some eyes on it if we want to target it for inclusion in a future release? :) |
I've put this in the 5.0 milestone since there is an existing PR, but if this isn't going to be done for then, we should move it to |
The existing PR for this depends on a new OpenGraph API endpoint, so I'd suggest this goes into a future release if that's the approach we want to take. I'd like to see unembeddable pasted URLs just end up in a paragraph block though, and that seems like a more realistic thing to get into 5.0 |
#11808 has a fix for this, and takes into account that we might want an OpenGraph block option in the future, so it's not tightly coupled to the paragraph block. |
Fixed with #12095 which solves it as follows:
|
Steps to reproduce:
http://codex.wordpress.org/Using_Themes
GIF:
The text was updated successfully, but these errors were encountered: