Skip to content
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

Pasting from MS Word fuses words #12293

Closed
IlonaGordon opened this issue Nov 25, 2018 · 7 comments
Closed

Pasting from MS Word fuses words #12293

IlonaGordon opened this issue Nov 25, 2018 · 7 comments
Labels
[Feature] Paste [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable Needs Testing Needs further testing to be confirmed. [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended

Comments

@IlonaGordon
Copy link

Describe the bug
Gutenberg version: Version 4.5.1

When pasting from MS Word, random spaces between words are deleted. Attempting to avoid this by pasting the segment into html editor creates one long paragraph, followed by an error message that warns the block has issues. Clicking to resolve issues produces a wall of text without paragraph breaks.

Attempting to avoid it by pasting the segment into WordPad or Notepad, saving as rtf or text, and then pasting it into the post also deletes paragraphs and produces a single block of text.

To Reproduce
Steps to reproduce the behavior:

  1. Copy some text from MS Word.
  2. Paste into Gutenberg.
  3. Wail in horror.

Expected behavior
Paste from MS Word is an essential function to me. I routinely paste long chunks of text into Wordpress and I would like Gutenberg to not glue my words together.

Screenshots
Pasting from Word:
screenshot 2018-11-25 14 14 14

Pasting into HTML:
screenshot 2018-11-25 14 25 33

Error message:
screenshot 2018-11-25 14 25 47

End result after resolving errors:
screenshot 2018-11-25 14 28 19

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Google Chrome
  • Version 70.0.3538.102 (Official Build) (64-bit)
@designsimply designsimply added [Type] Bug An existing feature does not function as intended [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Feature] Paste [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed labels Nov 25, 2018
@designsimply
Copy link
Member

Thank you for the report! I believe this is a duplicate of #11588 and so I'll close this issue and add a note there.

@jamiljonna
Copy link

jamiljonna commented Aug 13, 2019

I'm sorry @designsimply, but I do not think this is the same bug because it has been marked closed while the problem most certainly persists as of version 5.22. See below.

Copy text from MS Word 16.27 (OS X 10.14.6)

image

Paste into Wordpress

image

As you can see, both the hyperlinked and italicized words are fused with the following word in the sentence. I would wager to guess this also happens with other kinds of formatting. This was using the classic editor but the same issue arises in Gutenberg. For those who may be interested, I have been using the following GREP search/replace in BBedit to address this issue for about a year now.
Find: (<\/\w+>)(\w+)|(\w+)(<\w+>) |(<\/\w+>)(\w+)|(\w+)(<\w)|(,)([a-z])|(,")(<)|(>)(\()
Replace: \1\3\5\7\9\11\13 \2\4\6\8\10\12\14

@designsimply
Copy link
Member

Thanks for the note @jamiljonna! In your case, do the missing spaces after pasting from Word seem random or in your case are the missing spaces always after hyperlinked and italicized words?

@designsimply designsimply reopened this Aug 16, 2019
@designsimply designsimply added the Needs Testing Needs further testing to be confirmed. label Aug 16, 2019
@neilhinkle
Copy link

Not sure of the status on this one, but I can confirm that it is still an issue as of Wordpress 5.2.3. I just had to fix a post by one of the people on my company's marketing team where they wrote the post in Word and pasted the content directly into Gutenberg. The spacing seemed random to me and was mostly visible in Safari and Internet Explorer (my company is mostly B2B so it's still relevant, unfortunately). I did not experience the issue in Chromium-based browsers and did not have time to test for Firefox.

To fix it quickly, as there were ads pointing to the live post and I didn't have time to debug what was happening, I essentially had to go through the post in Safari and add the spaces where they belonged.

@ellatrix
Copy link
Member

Hi @IlonaGordon and @neilhinkle! Thanks for the report.

Could you share what the console is logging for you when you paste?

I'm looking for this:

Screenshot 2019-08-07 at 10 53 18

Please copy the text and paste it in between backticks:

```
content
```

Thank you!

@IlonaGordon
Copy link
Author

IlonaGordon commented Dec 10, 2019 via email

@ellatrix
Copy link
Member

Ok, great to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Paste [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable Needs Testing Needs further testing to be confirmed. [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants