#17068 closed defect (bug) (invalid)
Pasting text from Word does not have span tags cleaned anymore
Reported by: | mjaning | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | TinyMCE | Keywords: | |
Focuses: | Cc: |
Description
I usually paste text copied from Word doc using the visual editor in the post page. After upgrading to WP v-3.1 the pasting process has stopped cleaning the <span> tags which normally contains font and style attributes coming from Word doc.
After several tests I concluded (I did not find indeed) that some issue came bundled with WP-v3.1 in the \wp-includes\js\tinymce\plugins\paste\editor_plugin.js which is responsible for taking care of pasting process.
For confirming this theory I have replaced the files under \wp-includes\js\tinymce\plugins\paste\ with the same files from a previous WP version. After that, the pasting process started working again. The cleaning process is now keeping the HTML code perfectly clean, and the span tags were removed.
It does not matter if I am pasting straight to the text or if I am using the Paste From Word button, the cleaning process is just working fine in both ways.
Using WordPress 3.1, Customized Theme, W7 /CentOS release 5.5, FF4 / IE9 / Chrome10 / Opera 11 browsers
Attachments (3)
Change History (8)
@
14 years ago
File in Text Format Contains the HTML (not well cleaned) resultant of the paste process
#2
@
14 years ago
- Cc mjaning added
- Keywords needs-testing added; reporter-feedback removed
I attached 2 files you can use in your tests and/or comparisons. The word file was produced originally in a OS Windows XP and MS Word 2007. It was saved with .doc extension which is not the standard format for Word 2007.
The text file was copied from WordPress Editor in HTML mode after the paste process. It's purpose is only for you check about the results over here. Basically the <span> tag with font sytle should have being cleaned, but it remains inside.
I also reproduced the same results in a machine running Windows 7 and MS Word 2007.
I have a personal blog at WordPress.com (free plan) where I reproduced the same issue using the attached file.
Let me know if more info is needed.
PS. I can not reproduce the issue with all Word files I get, even when they come from the same Win XP / Word 2007 environment.
#3
@
14 years ago
- Keywords needs-testing removed
Confirmed with the file you attached (though I can't create a new file that has the same problem). Tried with TinyMCE 3.4.2 and it still happens. Bug reported upstream, let's see whether someone can figure out what is happening.
Until then, this works for me: Copy all of the text from the problematic file, paste it into a new Word document, and then copy->paste that into TinyMCE, and it works (strips out all the cruft). Weird.
Can't reproduce this in Win7/Word 2007. But it seems there are known issues with certain combinations of OS/Word, particularly Word 2011. What version of Word are you using?