Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#8594 closed Bug (duplicate)

Strange paste results when source is Excel

Reported by: oiha Owned by:
Priority: Normal Milestone:
Component: Plugin : Paste from Word Version: 3.0
Keywords: Cc:

Description

I have tested pasting from Excel either directly or through Word, and there are differences in visual expression and/or html code in most cases. It is particularly disturbing that there are differences between keystroke CTRL-V and using the Paste button.

The source for the test was a simple Excel 2010 spreadsheet with a 2x2 table where 2 cells had background color and all cells had border.

The result as witnessed in source-mode is supplied.

In neither case did the outside border survive. For direct pasting all methods are different even though paste buttons give the same visual result. Using Word as an intermediary gave the best result and paste buttons even gave identical results. There was still a visual difference between paste button and CTRL-V that obviously was refledted in the source code.

It seems like the methods are supported by separate code and that the code is not aligned.

There is also a question whether the documentation strongly enough emphasizes the importance of using Word as an intermediary to align text coding for paste operations.

Also: I set the two config flags to false to avoid removing font and style formatting, and removed cache.

Attachments (4)

pasting.txt (9.0 KB) - added by oiha 7 years ago.
Source code
8594.xlsx (9.5 KB) - added by Jakub Ś 7 years ago.
8594.xls (13.5 KB) - added by Jakub Ś 7 years ago.
CKEDITOR site results.doc (68.5 KB) - added by oiha 7 years ago.

Download all attachments as: .zip

Change History (11)

Changed 7 years ago by oiha

Attachment: pasting.txt added

Source code

Changed 7 years ago by Jakub Ś

Attachment: 8594.xlsx added

Changed 7 years ago by Jakub Ś

Attachment: 8594.xls added

comment:1 Changed 7 years ago by Jakub Ś

Keywords: IE8 removed
Status: newconfirmed
Version: 3.6.23.0

First of all - CKEditor makes it best to translate the information send from Word/Excel through the clipboard and many times it needs to come to an agreement. In those cases we prioritize semantics instead of formatting.
In all cases, the editor privileges semantics over formatting, so the end results will never look like the original. I believe this is understandable.

In neither case did the outside border survive.

If you look at code below you will see how browser sees it:

<TABLE style="WIDTH: 96pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=128>
<COLGROUP>
<COL style="WIDTH: 48pt" span=2 width=64>
<TBODY>
<TR style="HEIGHT: 15pt" height=20>
<TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: yellow; WIDTH: 48pt; HEIGHT: 15pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=20 width=64><FONT face=Arial>a</FONT></TD>
<TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: black; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl66 width=64><FONT face=Arial>b</FONT></TD></TR>
<TR style="HEIGHT: 15pt" height=20>
<TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: black; BORDER-RIGHT: windowtext 0.5pt solid" class=xl66 height=20><FONT face=Arial>c</FONT></TD>
<TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: black; BACKGROUND-COLOR: #92d050; BORDER-TOP: black; BORDER-RIGHT: windowtext 0.5pt solid" class=xl67><FONT face=Arial>d</FONT></TD></TR></TBODY></TABLE>

Notice border:0 for table element. There is nothing CKEditor can do here.


Now the bugs

It seems that we have problems with formatting content pasted from Excel.

To reproduce:

  1. Open one of samples provided and paste it into editor using CRTL+V button, paste button and paste from word button

Results:

  1. FF4 and above, Chrome, IE6-9 - Background is not preserved wwhen using paste from word button although it is present in HTML. CRTL+V button, paste button work.
  2. Opera and FF3.6 - In all cases there is no background
  3. Safari - table is pasted as paragraph (doesn't matter which command you use) (Described here #8639)
    <p>
    	&nbsp; &nbsp; &nbsp;a b c d &nbsp;</p>
    

Issue(s) has been reproducible from CKEditor 3.0.

Notes:

  1. In my tests all sizes were the same. I didn’t get the same results as @oiha
  2. When pasting first to word and then to excel everything seems to be fine (@oiha it should work without word as an intermediary).
Last edited 7 years ago by Jakub Ś (previous) (diff)

comment:2 Changed 7 years ago by Jakub Ś

Resolution: duplicate
Status: confirmedclosed

DUP of #6465

comment:3 Changed 7 years ago by oiha

Even though you have set this ticket as a duplicate, I will make my comments here instead of in the other ticket.

I appreciate the focus on semantics over formatting as all tools are different. Even user interaction is different with the introduction of line- and positional cursors in Word.

My main concern is that paste operations work differently dependent on whether its directly or through Word and by which method (of three) is used. I will repeat my tests and use the demo site to make sure we have a common ground. It disturbs me that you get a different result.

comment:4 Changed 7 years ago by oiha

Update after testing - now with IE9 and using 8594.xlsx as source. My implementation is verified to have the same build number as the demo site.

In the demo site I get the same result as you do. Paste from word button looses background and borders for cells. If you go via Word every cell gets an internal paragraph and all cells looses background and borders in all three cases. Direct approach is better for this implementation though I am a bit concerned with the td-classes.

Using my own implementation I still get my old results. I have included a table showing differences. For my implementation it seems like a Word-approach is better.

I attach visual results in both cases.

Changed 7 years ago by oiha

Attachment: CKEDITOR site results.doc added

comment:5 Changed 7 years ago by oiha

Final results on this matter:

I can reproduce your results in the first sample page supplied in the download. There is something wrong with my final implementation.

comment:6 Changed 7 years ago by Jakub Ś

@oiha thank you for the feedback. If there is anything you would like to add to the bug - new TC or proposed fix please do it in #6465.

comment:7 Changed 5 years ago by Frederico Caldeira Knabben

Component: Core : PastingPlugin : Paste from Word
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy