-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Can not convert a classic block with multiple links to blocks. Can't even paste multiple links #27551
Comments
I can reproduce the issue when pasting into a paragraph block, it does indeed converted to an embed, and that embed then can't be transformed back into the original content using the 'Convert to Link' option as the spaces are removed. I think this is the relevant code, it seems like gutenberg/packages/block-library/src/embed/transforms.js Lines 19 to 29 in 873f941
This could be a fairly simple fix, so will label as Good First Issue. Converting from a classic block worked ok for me. That might need further testing. |
|
That would be great @gaavar, let me know if you need any assistance! |
@talldan thank you so much! I got stuck with some failures while setting up the dev environment on WSL2 Ubuntu. Is there a slack channel or similar for gutenberg where I can ask for assistance on this? |
@gaavar What was the error? There is a slack instance (https://wordpress.slack.com/signup#/), and it's the #core-editor channel for Gutenberg development. Might also be worth searching the issues here to see if anyone else has had the same problem. |
My dev environment is all set up! Here's what I noticed: when I use a classic block and copy-paste a list of links (each on a new line), |
As a follow-up, examining the code portion I think the regex can be modified a bit to return True only if there's one URL in the |
@gaavar Glad you got it all set up 🎉 Yep, I think modifying the regex as you describe looks would be a good thing to try first. 👍 |
…iggering embed block (#27746) * modified isMatch to permit multiple links to be pasted without triggering embed block(#27551) * modified isMatch to permit multiple links to be pasted without triggering embed block(#27551) * modified isMatch to permit multiple links to be pasted without triggering embed block(#27551) * modified isMatch to permit multiple links to be pasted without triggering embed block(#27551) * modified isMatch to permit multiple links to be pasted without triggering embed block(#27551) * modified isMatch to permit multiple links to be pasted without triggering embed block(#27551)
Describe the bug
Whenever I try to:
It tries to embed those URLs as a single link.
Please see the screenshot:
https://gauravtiwari.org/wp-content/uploads/2020/12/screenshot-erro.gif
To reproduce
Steps to reproduce the behavior:
Paste multiple links at once, like these:
The List of Sites: https://addthis.com https://elegantthemes.com https://generatepress.com https://woocommerce.com https://backlinko.com https://elementor.com https://elmastudio.de https://wptavern.com
OR if a Classic Block already has a list of links, Convert that to blocks.
Screenshots
https://gauravtiwari.org/wp-content/uploads/2020/12/screenshot-erro.gif
Editor version (please complete the following information):
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: