-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Bug: Link sometimes embeds other times not. #21029
Comments
This makes sense to me. It sounds here like Gutenberg may be trying to be too clever. If Gutenberg is going to convert the link into an embed, showing the embed block placeholder feels like a good solution. |
Hi. I believe there are a couple of issues to discuss here:
|
Upon testing, this seems to be a regression between WP 5.2 and WP 5.3. |
Hi all, my issue is linked to from this but is slightly different - I would like Gutenberg to fallback to creating a regular hyperlink if the embed block is disabled. This only fails if the link is the only content on the line, but it is still causing an issue for one of the sites I am developing. This issue has been reported before here: https://wordpress.org/support/topic/paste-links-in-gutenberg-without-embedding/ I am happy to try to fix this issue myself - I know WordPress fairly well as an end-user and I have made my own custom blocks - but I could do with being pointed in the right direction. Thanks! |
This is a reasonable fallback. Just to be sure, how are you disabling the Embed block? |
This could be fixed with #17413. I've just updated that PR. Review would be helpful. Interestingly, for @joaquimds 's usecase, after disabling the Embed from the Block Manager, I tried pasting the link in the editor, it failed to put the content in the paragraph block. The paragraph block stayed empty. However, it could be treated as a separate bug (Happens in v7.8.1 as well). |
With #17413, you can convert the embed back to paragraph with a link. |
@mcsf I'm using the |
So the process should be: |
@paaljoachim @mcsf Looking at the code in Embed block, seems like, the logic to check if the url can be embedded or not, tightly coupled into the edit component itself. So editor would have to render the embed block first, check for validity and then go back to paragraph block to show the text link. Not sure if this is good flow. On the other hand, if we want to check for the validity inside the raw transform (that's what is executed as paste handler when user pastes a url into paragraph block), then I imagine, I would have to refactor existing embed block modules. Do we have consent of that big of a change? I wanted to get some thoughts on that, get a ✅ before I start implemnting it. |
Hey @desaiuditd Could you break down into more details what you said above? |
I made an Embed prototype. Check my post here: |
I'm addressing this in #24559 (I think 😅 ). Specifically, that PR prevents the block from attempting to transform into a specialized embed block variation if that variation isn't registered. |
I've investigated this problem in bobbingwide/oik#158 If the requirement is for all WordPress embeds to be shown in the editor then There's a related issue which questions if the blockquote should be displayed in the editor. #21945 In the frontend the blockquote is hidden. |
WordPress 5.3.2
Using Gutenberg version 7.7.1. (same affect when deactivating the Gutenberg plugin.)
Twenty Twenty theme.
Describe the bug
Adding a link through pasting a link into a paragraph block sometimes makes it into an embedded link and other times a text link.
To reproduce
Steps to reproduce the behavior:
I click the Convert to (text) link.
The result on the frontend showing an embed and a text link:
Here is an example where I also pasted the following link into a paragraph block: https://make.wordpress.org/test/2020/03/11/gutenberg-usability-testing-for-january-2020/
Frontend result showing three different visuals.
Expected behavior
I expect to be able to choose when or if I want a text link to be embedded.
If a link wants to embed, then I expect a dialog screen to show up similar to this mockup.
Desktop (please complete the following information):
Plugin support issues:
https://wordpress.org/support/topic/paste-links-in-gutenberg-without-embedding/
https://wordpress.org/support/topic/paste-link-without-creating-an-embed-block/
The text was updated successfully, but these errors were encountered: