#12946 closed Bug (invalid)
Copying word content on different browsers
Reported by: | pdolega | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Issue below happens on 4.4.7 version but I was able to reproduce it directly on demo page here: http://ckeditor.com/demo
I have been trying to copy and paste the contents of the Word file. Word is attached to this ticket.
Generally on Chrome 40.0.x it works correctly - here is the result: http://pbrd.co/1CGXRMe The problem occurs however on FF 30 (also IE 11 and also possibly further versions): http://pbrd.co/1CGXW2z It seems that numbering is being broken as a result of this operation.
The same thing happens if I use Paste from MS Word
option - although here it initially looks ok (here: http://pbrd.co/1CGXYHI ) after it still gets broken after pressing OK: http://pbrd.co/1CGY4yZ
Attachments (1)
Change History (4)
Changed 10 years ago by
Attachment: | lista.docx added |
---|
comment:1 Changed 10 years ago by
Keywords: | word numbering table removed |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Version: | 4.4.7 |
Result is the same on Chrome and Firefox. Please refresh your browser’s cache. I can't confirm that result looks 1:1 when pasting with Chrome thus i will have to close this ticket as invalid.
Please note that in all cases, the editor privileges semantics over formatting, so the end results will never look like the original.
CKEditor makes it best to translate the information send from Word through the clipboard and many times it needs to come to an agreement. In those cases we prioritize semantics instead of formatting.
In short - we have word formatted HTML and browser HTML which are two different things (only similar) and result will never look 1:1.
One thing that you will not overcome, are lists you have used for numbering. In word there is possibility to continue numbering in each new cell. In HTML you can't split list between cells. In each cell a new list is created. That is why you see 1. in all cells.
Sure there might be code that looks at cell above and takes next number but once you start editing such table, remove or insert rows it may get pretty messy and writing huge code for such small thing doesn't quite fit here.
The best solution here is not using lists for numbering cells in MS Word.
What you can do:
- Have these two set to false: http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-pasteFromWordRemoveFontStyles, http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-pasteFromWordRemoveStyles
- Configure ACF with http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraAllowedContent. I would not simply turn it off but configure it so that editor knows which tags, attributes and styles you want to have assigned to tables.
- configure contents.css accordingly to your needs. I have noticed the height difference in paste dialog and editor which might be influenced by (since there is no height style assigned directly to TD) paddings, margins, line heights and font sizes thus you might want to adjust contents.css to what you have in word for tables.
comment:2 Changed 10 years ago by
First of all - thanks for the thorough answer. This is really helpful.
One thing I don't understand [citation follows]:
`
Result is the same on Chrome and Firefox. Please refresh your browser’s cache. I can't confirm that result looks 1:1 when pasting with Chrome thus i will have to close this ticket as invalid.
`
Does this mean that you cannot reproduce the problem or that two pasted images are the same ? (they are not - look at the numbering in the first column).
I'll also take a look at suggested solutions (thanks!).
So from what I understand - it seems that the whole thing working on Chrome is incidental - it shouldn't work in general (numbering scattered across multiple cells) ?
comment:3 Changed 10 years ago by
Comment was unclear. I'm sorry.
What I have meant is that results were the same in Firefox and Chrome and both were different than in MS Word.
I'm not sure how have you managed to get almost or same look as in MS Word but in default editor and default Chrome (without any custom plugins and without any modifications) result is quite different.
docx file for reproducing problem