-
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
Operation on text randomly merges words #11588
Comments
Hi @Siguardius! I cannot reproduce the problem, we'll need some more information. Could you share what was logged in the browser console when you paste the text from LibreOffice? |
@iseulde This is everything that was in the console. |
Noting an additional report of this from a duplicate at #11626 and their testing steps for reference:
|
I just noticed the same when copying content which was on separate lines because each line was actually a <div>Some Text <a href="https://example.com"><u>Some link</u></a></div><div>Some Text <a href="https://example.com"><u>Some link</u></a><br /></div><div>Some Text <a href="https://example.com"><u>Some link</u></a><br /></div><div>Some Text <a href="https://example.com"><u>Some link</u></a><br /></div><div>Some Text <a href="https://example.com"><u>Some link</u></a><br /></div> The "Received plain text:" part in the console properly shows the content on individual lines. The "Processed HTML piece:" section shows almost the identical HTML, but without the divs. Leading to the pasted content being on a single line. |
Is it possible that the culprit of this bug could be these changes? #10019 |
I found a temporary fix for this. I added this code after line 218 in the raw-handling code:
It replaces all new lines with spaces. This is probably not ideal, but at least it lets you paste content from Word without randomly merging words again. |
Yes, we'll have to handle this in the raw handling and/or creating rich text values, maybe along with other non meaningful whitespace. I think what should happen is stripping leading and trailing non meaningful whitespace entirely, and collapsing multiple non meaningful white space characters into a single one. |
See also https://medium.com/@patrickbrosset/when-does-white-space-matter-in-html-b90e8a7cdd33. What we have to do in rich text values seems to be: replace |
Tested and confirmed using WordPress 4.9.8 and Gutenberg 4.3 by copying content from a word processing app to Gutenberg. I noticed the missing spaces match up with the line breaks in the Received HTML after pasting content: LibreOffice document I copied from: Tested with LibreOffice 6.0.6.2 on macOS 10.13.6.WordPress post I pasted into: Seen at http://alittletestblog.com/wp-admin/post.php?post=15818&action=edit running WordPress 4.9.8 and Gutenberg 4.3 using Firefox 63.0.1 on macOS 10.13.6.Console output for reference:
|
I'll work on a fix asap. |
FYI, my fix from here still works: #11588 (comment) |
Could anyone test #12093? |
how I can test that? |
Closed #12293 as a duplicate. |
I noticed that #12093 was superseded by #12166. I tested #12166 and left a comment with my findings (#12166 (comment)). @sae13 the main way to test pull requests would be to install a local development environment as outlined in https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md#getting-started and then use I also found another way to test but you need to be logged in to GitHub and know the URL (I think). Go to https://github.com/WordPress/gutenberg/tree/try/rich-text-newlines-to-space and click the "Clone or download" button. That will give you a version of the plugin running the |
Glad this is being worked on as it does this is every sentence pasted in. If you copy/paste to wordpad then it works fine, but having to do 2 steps with what was only 1 step before in Classic Mode seems counterproductive. |
The fix will be shipped in WordPress 5.0.1. |
now button colors not working 🤣 |
Just to confirm that WordPress 5.0.1 has no fixed this. Copying from Word 2016 still has the problem |
Oddly enough, it actually has fixed the issue for me. I'm also able to
highlight blocks of words now unlike before.
The only difference now is that if I try to edit an older article, it won't
let me do it. It actually acts like the way 5.0 did when I tried to use
Gutenberg.
…On Thu, Dec 13, 2018 at 12:13 AM MightyGadget ***@***.***> wrote:
The fix will be shipped in WordPress 5.0.1.
Just to confirm that WordPress 5.0.1 has no fixed this. Copying from Word
2016 still has the problem
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11588 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYnSvDoxyw9HuUfnscoadUbB4XxLczZJks5u4fAGgaJpZM4YSlBe>
.
|
@MightyGadget Since 5.0.1 is a security release only, it will be fixed 5.0.2 now. ETA is next week. |
I thought it was just me! I have upgraded to 5.0.1 and am finding that copying from Word into Wordpress draft article is also merging words. Also, if I am scheduling a post rather than posting it immediately it doesn't seem to be doing the automatic spell check (which I would hope would pick up these merged words). Any idea where the spellcheck function is now? |
I had that issue when updating to 5.0 but after 5.0.1 I was able to copy paste from Word into WP. Now it just won't let me edit older articles so back to Classic Editor. It'll get there. |
I can also confirm that this bug still exists in WordPress 5.0.1 with documents pasted from Word 2016. Copying text from a Word File into a Google doc and then into Gutenberg somehow bypasses the issue. |
It looks like some of my existing posts created before 5.0 are impacted by the missing space issue when the posts are converted to blocks. So the posts are correct until I go to edit the old posts and select "convert to blocks." At that point it seems like a few spaces in between words per paragraph disappear. |
I can also confirm that I get regular complains from my costumers, that pasting from Word is getting cropped of spaces between words. |
This issue should have been fixed in WordPress version 5.0.2 released on December 19, 2018. If you are still having trouble after updating to WordPress 5.0.2 or later, please leave a new comment there noting your WordPress version and any relevant details you think may be helpful (i.e. you are using a very old version of Word). Thank you! |
Describe the bug
When interacting (bolding, inserting links) with text block that has pasted content with prior formatting, block will randomly merge a few words in the text.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A few worlds in the text block will be merged.
Screenshots
![zrzut ekranu 2018-11-07 o 15 16 23](https://user-images.githubusercontent.com/11268816/48138609-f8b62280-e2a4-11e8-84e8-fa546a615ddc.png)
![zrzut ekranu 2018-11-07 o 15 16 31](https://user-images.githubusercontent.com/11268816/48138624-0075c700-e2a5-11e8-8e2e-f818c7bc0ab9.png)
BEFORE:
AFTER:
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: