Opened 8 years ago

Closed 7 years ago

#14555 closed Bug (fixed)

Texts changes to some weird characters when pasting table from Word

Reported by: Ugur Ozkan Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0.1
Keywords: Cc:

Description

Steps to reproduce

  1. Copy table from Word (either CTRL + C or right click -> Copy)
  2. Open ckEditor Demo from http://ckeditor.com/demo
  3. Paste it (either use CTRL + V or right click -> Paste or one of the paste buttons above [except the middle one])

Expected result

Same output as seen in the Word

http://s16.postimg.org/wfd01ffo5/Capture.png

Actual result

http://s28.postimg.org/ln5z3uhul/Capture.png

Other details (browser, OS, CKEditor version, installed plugins)

OS: Windows 10
CKEditor version: latest version as stated here https://dev.ckeditor.com/wiki/Bugs#ReproduceonDemoPageandorNightlyBuild
Browser: Chrome Version 49.0.2623.87 m

Attachments (3)

testText.docx (33.8 KB) - added by Ugur Ozkan 8 years ago.
Test Input
testTextOriginal.docx (32.9 KB) - added by Ugur Ozkan 8 years ago.
Whole test text
tableInList.docx (14.6 KB) - added by Jakub Ś 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by Ugur Ozkan

Attachment: testText.docx added

Test Input

comment:1 Changed 8 years ago by Ugur Ozkan

Interestingly the popup window that appears when clicking one of the paste buttons above shows everything normally.

comment:2 Changed 8 years ago by Jakub Ś

Keywords: Word Table Copy-Paste removed
Status: newconfirmed
Version: 4.5.74.0.1

This is werid, especially when looking at below HTML from 3 different cells. First one is ok while two others get interpreted as lists although HTML looks the same.

Problem can be reproduced from CKEditor 4.0.1 in Firefox and Chrome. IE works as expected. I also need to add that native contenteditable elements like div and iframe interpret whole table correctly.

  <td width="161" valign="top" style="width:120.5pt;border-top:none;border-left:none;
  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt">
  <p class="MsoListParagraphCxSpMiddle" align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center;"><span lang="TR" style="font-size:10.0pt;mso-ascii-font-family:Calibri;mso-hansi-font-family:
  Calibri;mso-ansi-language:TR;mso-bidi-font-weight:bold">Ders Adı<o:p></o:p></span></p>
  </td>


  <td width="66" valign="top" style="width:49.6pt;border-top:none;border-left:none;
  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt">
  <p class="MsoListParagraphCxSpMiddle" align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center;"><span lang="TR" style="font-size:10.0pt;mso-ascii-font-family:Calibri;mso-hansi-font-family:
  Calibri;mso-ansi-language:TR;mso-bidi-font-weight:bold">Not<o:p></o:p></span></p>
  </td>


  <td width="57" valign="top" style="width:42.5pt;border-top:none;border-left:none;
  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt">
  <p class="MsoListParagraphCxSpMiddle" align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center;"><span lang="TR" style="font-size:10.0pt;mso-ascii-font-family:Calibri;mso-hansi-font-family:
  Calibri;mso-ansi-language:TR;mso-bidi-font-weight:bold">G<o:p></o:p></span></p>
  </td>

NOTE: When I check format of text entered in cells, I can see they all have "List Paragraph" format and when you assign for example "No spacing" or "Normal", table is pasted correctly. @uguurozkan could you perhaps explain why have you created table content with that sort of formatting in MS Word?

comment:3 Changed 8 years ago by Ugur Ozkan

The table is part of a list element. There is some text before it and another list element after it. So, when the table is added, format comes automatically. I added whole test text so you can see.

Changed 8 years ago by Ugur Ozkan

Attachment: testTextOriginal.docx added

Whole test text

Changed 8 years ago by Jakub Ś

Attachment: tableInList.docx added

comment:4 Changed 8 years ago by Jakub Ś

Thank you for explanation. You are right table in list gets List Paragraph formatting. That is correct.

Looking at your example however I must say - what you have is not a list but simply paragraphs with numbers in fornt. Please see tableInList.docx file. This is how it should look like and result after pasting is correct (I will get to that in detail in a sec). It is still a mystery, at least to me, how such table can be created (what needs to be clicked in MS WORD) on daily basis.
Having said all that, it is worth looking into this ticket despite, me not knowing how to create such table, since it has worked in CKEditor 4.0.0 .


The result from my file: List will get pasted as three different lists and this is correct because browser sees this code as:

List Paragraph
List Paragraph
Table
List Paragraph
Table with List Paragraph inside
List Paragraph

Tables have no information that they are part of list, thus browser sees it like shown above and CKEditor interprets it as 3 lists. There is not much we can do in such case.

comment:5 Changed 7 years ago by Jakub Ś

Resolution: fixed
Status: confirmedclosed

Problems mentioned in this ticket can no longer be reproduced in latest CKEditor 4.6.2

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy