#11950 closed Bug (invalid)
Paste from Word fails with table from Excel
Reported by: | Alasdair Ross | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Plugin : Paste from Word | Version: | |
Keywords: | Cc: |
Description
Pasting a table either directly from Excel, or via Word results in lost formatting.
Attached is an example table in Excel (2013) (Table Test.xlsx). If I copy this, you can see the html stored in the clipboard in the "Excel Clipboard Contents.txt" (found using Notepad++).
If I paste directly from Excel into the Demo (http://ckeditor.com/demo#full) I see a table with no formatting at all. See "Paste from Excel.png" and "Paste from Excel Source.txt" for the output provided by the "Source" link in the demo.
If I paste directly from Excel using the "Paste from Word" plugin, no formatting is carried into the popup. See "Paste From Excel PFW PopUp.png". The output is identical to pasting directly from Excel (without using the PFW button/plugin).
If I copy the table from Excel, paste it into Word, then copy the table from Word (see "Test Table.docx") I get the following behaviour. See "Word Clipboard Contents.txt" for what was on the clipboard:
Pasting from Word directly into the editor gives a table that has retained the 'bold' headings from the table, but no other styles. See "Paste From Word Source.txt" and "Paste From Word.png".
Pasting from Word into the PFW plugin gives the correct table in the PFW plugin pop-up (see "Paste From Word PFW PopUp") but the same result as if the table was pasted not using the plugin.
I've seen the same results locally. These tests were run with Office 2013, Windows 8.1 and Firefox 29.0.1.
Attachments (10)
Change History (14)
Changed 11 years ago by
Attachment: | Excel Clipboard Contents.txt added |
---|
Changed 11 years ago by
Attachment: | Paste From Excel PFW PopUp.png added |
---|
Paste From Excel PFW PopUp
comment:1 Changed 11 years ago by
Component: | General → Plugin : Paste from Word |
---|---|
Version: | → 4.4.0 |
comment:2 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Version: | 4.4.0 |
- Pasting with Crtl+V and with PFW dialof always activates PFW is content is recognized to come from MS Word.
- CKEditor has two options that enable style pasted from word. Please see http://docs.ckeditor.com/#!/api/CKEDITOR.config. Your table will work with below 3 options turned on/off. NOTE: we recommend turning off ACF only when your CKEditor is meant to allow users to enter all HTML tags.
var editor = CKEDITOR.replace( 'editor1', { allowedContent : true, pasteFromWordRemoveFontStyles : false, pasteFromWordRemoveStyles : false });
- We don't support pasting from Excel currently. It works in most cases but there are issues:
http://dev.ckeditor.com/ticket/8639
http://dev.ckeditor.com/ticket/6465
comment:3 Changed 11 years ago by
- OK
- I'd downloaded the 'full' version and using the simple example page, tried the pasteFromWord settings in the config.js and they had no effect (perhaps that's a separate bug).
Putting the settings in the html file did make them take effect and the Word formatting is retained now.
- Are there plans to add support for pasting from Excel?
I wouldn't say it works 'in most cases'. I've found very little formatting gets carried across.
I know excel puts all its styles in the header of the html doc that's on the clipboard (see attached example) so they're not inline in the fragment of html to be pasted. Do you know if the browser has access to this clipboard information so the plugin could be modified to convert the styles to be inline with the fragment to be pasted?
comment:4 Changed 11 years ago by
- It works correctly. Either you have used invalid synatx or you haven't refreshed cache.
- "Are there plans to add support for pasting from Excel?"
Yes, but in the future.
About styles visible in browser - I see that only IE manages it (converts to inline styles) but all other browsers don't see styles just plain HTML.
Clipboard contents after copying table from Excel