-
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
Regression in Gutenberg 11 around pasting with spaces? #33283
Comments
hi @pansamolot I just attempt to replicate this and was unable to succeed? What did I miss? Screen.Capture.on.2021-07-21.at.15-33-35.mp4Also can I verify you aren't using any WordPress Plugins, browser extensions or system level modifications that might alter your OS's pasting mechanics? If it still happens for you, then perhaps you could try this on a clean install using a clean browser to see if that solves things? You've probably already done this but I felt it was worth checking as I've seen this be the case for other similarly reported issues. If there is a repeated problem with this and we can replicate then we will look to cover with unit tests. Much appreciated. |
I have just quickly setup as-clean-as-possible installation of Wordpress on Amazon Lightsail (to throw out any possible connections to my main hosting's configuration). It has nothing except:
And I can confirm that this bug exits even from the very first line of text written. At this moment I am on another device, so I cannot create an animated gif to show this, but I hope to post it in a couple of hours. I am not aware of any system settings, browser extensions etc. that can influence my "pasting experience". Wordpress is the only web service that suffers this problem for me even though I am using the same PC, system and browser for pasting texts in dozens of services. The only other exception is Gmail, but it is a well known, years-long bug in Gmail itself that it adds spaces around pasted text. |
Thanks for confirming - much appreciated. Let's see if we can get other folks to verify the bug and also perhaps some Windows users. In the meantime any more detail and examples you can provide including those animated GIFs will really help. |
I finally managed to get a BrowserStack login and gave this a spin on Windows 10 with Edge 91 and was able to replicate: Screen.Capture.on.2021-07-21.at.17-05-19.mov |
This comment has been minimized.
This comment has been minimized.
I tested in the following environment: Development EnvironmentInstall npm package only
WordPress informationWordPress version: Device informationDevice: Notebook PC, i5-1035G1 CPU, 16 GB RAM Test Results
6370970b1284119195a77bf1a1e9ab6b.mp4A space will be inserted at both ends of the text only when I copy the text in the block editor and paste it in the same block editor. |
I don't know the cause as I don't have a deep understanding of Gutenberg. |
You are welcome. I think @t-hamano has it with this post which has details on that is going on with this fragment business. https://discuss.prosemirror.net/t/space-added-on-paste/1274/7 As a member of the dev team, I'll see if I can look into a fix tomorrow. Update: ok I lied. I have a fix PR available now in #33607. It's not ready for full review yet but it should work to fix the issue. |
Blasting, light speed and amazingly fast! :> Thank you! :> |
@pansamolot Would you be able to try and test the PR for me? You can use these instructions to do this pretty easily and quickly. |
@getdave Just made a quick test of your PR on a brand new AWS Wordpress instance and from my perspective the issue is solved. There are no spaces added in any scenario where they're not expected and there are spaces added when they are expected (i.e. when copy-pasting a piece of text that actually contains beginning and ending space). Due to the limited time resources I only managed to test this by making various pieces of text around the same blog post in Wordpress. I did not had a chance to test external-to-Wordpress or Wordpress-to-external copy-paste, but that was working even previously, so I assumed that your PR did not changed anything around here. Thank you, great job! |
Description
Gutenberg 11.0.0 was auto-updated this morning to my blog network. And I again see problem reported a 1+ year ago about adding surrounding spaces when pasting a text.
I have a feeling that this is at least 3rd time deja vu in Gutenberg. Are there any reported regression that is causing again something that was year ago reported as resolved?
Step-by-step reproduction instructions
Expected behaviour
Pasted text is exactly the same as copied from source.
Actual behaviour
Pasted text is surrounded with spaces.
Screenshots
WordPress information
Device information
The text was updated successfully, but these errors were encountered: