Opened 9 years ago
Last modified 2 months ago
#40882 new defect (bug)
Characters omitted when copying and pasting from Word
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 4.7.5 |
| Component: | TinyMCE | Keywords: | |
| Focuses: | javascript | Cc: |
Description
I have been preparing WordPress pages by arranging the information in Microsoft Word 2016, and then copying it from Word and pasting it into WordPress. My pages almost all include citations that I've copied from Google Scholar and pasted into Word.
I noticed recently that in the citations, the following characters would be missing:
- the (nonbreaking) space that follows the italicized publication name
- the volume number that follows after that
- the period that follows after that
When I first noticed this, I went back through 70+ pages and it looked like these characters had been omitted every time.
Note that when this happened again on another page yesterday, I decided to report a bug. I had already deleted the Word source file, so I tried to reproduce the behavior with a small new Word file. I found that I was never able to reproduce this behavior.
Today I saw this behavior again on yet another new page. This time I've saved the Word source file, and I've confirmed that this happened again when I copied and pasted again.
Please fix this if at all possible. Copying and pasting is such a reliable operation normally in every modern application that it's fairly easy to not realize that in WordPress this operation introduces errors that need to be fixed.
Thanks!
Attachments (1)
Change History (6)
#1
@
9 years ago
Can you elaborate on the steps to reproduce? What version of WordPress?
Are you in Visual mode or text mode of the editor? Did you toggle the button to paste from Word (or text)?
#2
@
9 years ago
I’m running WordPress 4.7.5 in Google Chrome in Windows 7 Home Premium.
Steps to reproduce using attached file:
http://whatworks.site/ (my site that's running WordPress)
+ New, Page
Double-click 2003 Emotional Convergence Between People Over Time.docx (the demo file I attached to the original ticket)
Ctrl-a, Ctrl-c
Click on the workspace of the WordPress visual editor
Ctrl-v
Resulting characters in reference 2 (near the bottom of the page):
Anderson, Cameron, Dacher Keltner, and Oliver P. John. "Emotional Convergence Between People Over Time." Journal of Personality and Social Psychology5 (2003): 1054-1068.
#4
@
2 months ago
- Keywords reporter-feedback added; needs-testing removed
Reproduction Report
Environment
- WordPress: 7.0-alpha-61215-src
- PHP: 8.2.29
- Server: nginx/1.29.4
- Database: mysqli (Server: 8.4.8 / Client: mysqlnd 8.2.29)
- Browser: Chrome 144.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.1
Steps taken
- Copy the entire document provided by the reporter from MS Word.
- Paste it in a post.
- Observe the words in the paragraph pointed out by the reporter.
- ❌ Bug is not occurring
Expected behavior
- The entire text was pasted as is with no loss of character.
Additional Notes
- You might notice that in the screencast below word count seems to have reduced after pasting. That's not the case; it's just a weird difference in what MS Word considers as words versus what WordPress counts as words.
- For MS Word, the list numbers and "&" count as words, but that's not the case for WordPress.
- While I do believe this issue is fixed in recent versions of WP, I will be removing the
needs-testingkeyword and addingreporter-feedbackin case the issue is still present.
Screenshots/Screencast with results
#5
@
2 months ago
- Component changed from Editor to TinyMCE
- Focuses javascript added
- Keywords reporter-feedback removed
The missing number can still happen with the Classic Editor. Like #63769, this is caused by the paragraph-to-list conversion in the TinyMCE Paste plugin. The sample document includes '84.5' inside an ordered list item, and pasting the document's contents removes '84.' and the preceding space. Within a regular paragraph, the number '84.5' remains intact.
The main problem is where the script removes ignored nodes, including nodes that are not at the beginning of the paragraph.
Environment
- WordPress: 6.9.1
- PHP: 8.2.30
- Server: Apache
- Database: mysqli (Server: 8.4.5-5 / Client: mysqlnd 8.2.30)
- Browser: Chrome 144.0.0.0
- OS: Windows 10
- Microsoft Word 2016
- Theme: Twenty Fifteen 4.1
- MU Plugins: None activated
- Plugins:
- Classic Editor 1.6.7
- Test Reports 1.2.1
Example of a file that causes the error when I copy from the file and paste into WordPress