Opened 4 years ago

Last modified 3 years ago

#14581 confirmed Bug

Pasting from MS Excel to CKEditor using IE loses background colors IF cells are resized from the default prior to copying

Reported by: Ehman Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0
Keywords: IBM Cc: jonathan.ehman@…, satya_minnekanti@…

Description

I am aware of #6465 and the many duplicates, as well as #13623.

It seems likely that this issue is the same, in that CKEditor is depending upon what the browser sends from the system clipboard with the paste event. However, somehow, this works fine in Google Apps (Gmail) and Office 365 (I'm sure Office 365 has some kind of inside track here, but how would Google Apps?).

Perhaps CKEditor is removing the colors in this case?

We have received customer complaints regarding this issue, therefore I am obliged to report it.

Steps to reproduce

  1. Open MS Excel
  2. Add background colors to some cells
  3. Change the width of the cells in question
  4. Copy the cells
  5. Paste to CKEditor in IE browser window

Expected result

Background colors are maintained along with formatting

Result from editor.on("paste") event.data.dataValue without resizing the cells:

<table width="128" style="width: 96pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0"><font face="Times New Roman" size="3">

 </font><colgroup><col width="64" style="width: 48pt;" span="2"><font face="Times New Roman" size="3">
 </font><tbody><tr height="20" style="height: 15pt;"><font face="Times New Roman" size="3">
  </font><td width="64" height="20" style="border: 0px black; width: 48pt; height: 15pt; background-color: yellow;"><font face="Calibri" size="3">Test</font></td><font face="Times New Roman" size="3">
  </font><td width="64" style="border: 0px black; width: 48pt; background-color: transparent;"><font face="Calibri" size="3">Super</font></td><font face="Times New Roman" size="3">
 </font></tr><font face="Times New Roman" size="3">
 </font><tr height="20" style="height: 15pt;"><font face="Times New Roman" size="3">
  </font><td height="20" style="border: 0px black; height: 15pt; background-color: transparent;"><font face="Calibri" size="3">Super</font></td><font face="Times New Roman" size="3">
  </font><td style="border: 0px black; background-color: rgb(31, 73, 125);"><font face="Calibri" size="3">Test</font></td><font face="Times New Roman" size="3">
 </font></tr><font face="Times New Roman" size="3">

</font></tbody></table>

Actual result

Background colors are missing

Result from editor.on("paste") event.data.dataValue after resizing the cells:

<table width="157" style="width:157px;" border="0" cellspacing="0" cellpadding="0"><tbody><tr height="20"><td height="20" style="width:93px;height:20px;">Test</td><td style="width:64px;">Super</td></tr><tr height="20"><td height="20" style="height:20px;">Super</td><td>Test</td></tr></tbody><colgroup><col /><col /></colgroup></table>

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

Windows 7

MS Office 2010 Internet Explorer 11

CKEditor version 4.5.7

config = {
   "toolbar" : 'WCToolbar',
   "toolbar_WCToolbar" :
      [
        ['attachFileButton'],
        ['Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'NumberedList', 'BulletedList', 'Blockquote', 'Outdent', 'Indent', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'Link', 'Image', 'addImage', 'spellCheckButton'],
        ['expandCollapseButton'],
        '/',
        ['Format','Styles', 'Strike','-','Subscript','Superscript', 'Table','HorizontalRule','SpecialChar', 'Unlink','Anchor', 'ShowBlocks','Source', 'Maximize','DocProps','-','Preview'],
        '/',
        ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat', 'Templates']
      ],
      "fontSize_sizes" : '8pt;9pt;10pt;12pt;14pt;18pt;24pt;36pt',
      "tabSpaces" : 5,
      "removePlugins" : 'elementspath,magicline',
      "allowedContent" : true,
      "extraPlugins": 'expandCollapseButton,altnplugin,attachFileButton,spellCheckButton,simpleuploads',
      "defaultLanguage" : 'en',
      "disableNativeSpellChecker" : false,
      "browserContextMenuOnCtrl" : true,
      "enterMode" : CKEDITOR.ENTER_DIV,
      "skin" : 'office2013',
      "resize_enabled" : false,
      "toolbarCanCollapse" : false,
      "toolbarStartupExpanded" : false,
      "image_previewText" : ' ',
      "removeDialogTabs": 'link:upload',
      "templates_files": [ '&View=StandardResponses' ],
      "templates_replaceContent" : false,
      "startupFocus" : true,
      "contentsCss" : "&View=Compose&ContentType=css&ReturnCSS=1",
      "extraAllowedContent": 'div b i a table thead tbody tfoot tr th td',
      "pasteFromWordRemoveFontStyles" : false,
      "pasteFromWordRemoveStyles" : false,
      "customConfig":""
}

Change History (2)

comment:1 Changed 4 years ago by Jakub Ś

Component: Plugin : Paste from WordGeneral
Keywords: Excel Paste removed
Status: newconfirmed
Version: 4.5.74.0

This is very weird but true. Resized table gets styles removed when pasted into CKEditor even if below 3 properties are set properly:

allowedContent: true,
pasteFromWordRemoveFontStyles : false,
pasteFromWordRemoveStyles : false

Problem can be reproduced at least from CKEditor 4.0

comment:2 Changed 3 years ago by Satya Minnekanti

Cc: satya_minnekanti@… added
Keywords: IBM added
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy