#6465 closed Bug (wontfix)
Paste: content pasted from Excel document loses formatting
Reported by: | Paweł Horzela | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Pasting | Version: | 3.0 |
Keywords: | CantFix | Cc: | kenny.demetter@… |
Description (last modified by )
NEW CORRECT TC:
It seems that we have problems with formatting content pasted from Excel.
To reproduce:
- Open one of samples provided and paste it into editor using CRTL+V button, paste button and paste from word button
Results:
- IE6-9 - Background is not preserved when using paste from word button although it is present in HTML. CRTL+V button and paste button work on the other hand.
- Opera, Chrome and FF - In all cases there is no background
- Safari - table is pasted as paragraph (doesn't matter which command you use). I have described this as separate issue #8639)
<p> a b c d </p>
Issue(s) has been reproducible from CKEditor 3.0.
Attachments (4)
Change History (28)
Changed 14 years ago by
comment:1 Changed 14 years ago by
Description: | modified (diff) |
---|---|
Summary: | ckeditor paste from word detection difference ctrl v and button excel → Paste: text pasted from word is cleaned up even when you select 'Cancel' on prompt window |
comment:2 Changed 14 years ago by
Status: | new → confirmed |
---|
comment:3 follow-up: 4 Changed 14 years ago by
comment:4 Changed 14 years ago by
Replying to paho:
Using 'Ctrl+V' works only for IE8. For other browsers it doesn't work as well.
When there's no prompt triggered for content from MS Excel in other browsers, it's because there's no cleanup needed.
comment:6 Changed 14 years ago by
WFM as well, I have used a custom cleanup function from #7304 to make sure it is not executed when 'Cancel' is pressed.
comment:7 Changed 14 years ago by
Keywords: | IE added |
---|---|
Status: | pending → confirmed |
Summary: | Paste: text pasted from word is cleaned up even when you select 'Cancel' on prompt window → Paste: content pasted in IE from Excel document loses formatting |
The original TC is wrong. This issue has nothing to do with the pastefromword plugin. To prove it, I managed to reproduce it with:
config.removePlugins='pastefromword';
The only thing you need to reproduce it, is to set in IE8: "Tools -> Internet Options -> Security -> Custom Level -> Scripting -> Allow programmatic clipboard access" to Enable.
Remember to run it in IE7 mode. I have confirmed this issue also in IE6.
Having IE configured in the right way, copy contents from input.xls and paste it with the "Paste" button. Note that the formatting is lost, all colors are gone (see the screenshot).
Changed 14 years ago by
Attachment: | ie8_6465.png added |
---|
comment:8 Changed 13 years ago by
Keywords: | IE removed |
---|---|
Summary: | Paste: content pasted in IE from Excel document loses formatting → Paste: content pasted from Excel document loses formatting |
#8594 was marked as duplicate
comment:9 Changed 13 years ago by
Version: | → 3.0 |
---|
Below is the comment from #8594 - the issue concerns all browsers
It seems that we have problems with formatting content pasted from Excel.
To reproduce:
- Open one of samples provided and paste it into editor using CRTL+V button, paste button and paste from word button
Results:
- IE6-9 - Background is not preserved when using paste from word button although it is present in HTML. CRTL+V button and paste button work on the other hand.
- Opera, Chrome and FF - In all cases there is no background
- Safari - table is pasted as paragraph (doesn't matter which command you use). I have described this as separate issue #8639)
<p> a b c d </p>
Issue(s) has been reproducible from CKEditor 3.0.
Note:
- When pasting first to word and then to Excel everything seems to be fine but this should work without Word.
Changed 13 years ago by
Changed 13 years ago by
comment:10 Changed 13 years ago by
I've created an Excel document with a single cell filled with the number "1". I've then made it bold, with red font and yellow background.
By checking the raw data the browser receives from Excel on pasting, without passing it through the editor, I found that we'll hardly be able to do something here.
The following is what I had with Firefox:
<table width="64" border="0" cellpadding="0" cellspacing="0"><colgroup><col width="64"></colgroup><tbody><tr height="19"> <td class="xl65" style="height:14.4pt; width:48pt" align="right" height="19" width="64">1</td> </tr></tbody></table>
This is IE instead:
<TABLE style="WIDTH: 48pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=64> <COLGROUP> <COL style="WIDTH: 48pt" width=64> <TBODY> <TR style="HEIGHT: 14.4pt" height=19> <TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: yellow; WIDTH: 48pt; HEIGHT: 14.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl65 height=19 width=64 align=right><STRONG><FONT color=#ff0000 face=Calibri>1</FONT></STRONG></TD></TR></TBODY></TABLE>
So we can see that the formatting information is simply not passed to FF. Additionally, despite the additional information available with IE, we have no ways to "sniff" this data to understand that it comes from Excel. So, there is no chance for us to work on it to make it better. At the current stage, at least.
comment:11 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:13 Changed 12 years ago by
User @linnex in #9114 has suggested a fix.
Hi,
I tried to explain it above, maybe I wasn't exact enough though.
I just added one line to the following code snippet in "pastefromword\filter\default.js"
// Otherwise provide a black-list of styles that we remove. [ [ ( /^mso-/ ) ], // Fixing color values. [ ( /-color$/ ), null, function( value ) { if ( value == 'transparent' ) return false; if ( CKEDITOR.env.gecko ) return value.replace( /-moz-use-text-color/g, 'transparent' ); // 2012-07-25 linnex: the following line is new return value; } ],
I believe the problem is the blacklist that falsely removes all back-colors from Excel pastes instead of transparent only.
It worked for me.
Cheers linnex
comment:15 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:19 Changed 11 years ago by
I have checked this issue one more time on Mac and Windows.
The problem is that CKEditor doesn't have much to do here. It is the browsers that don’t see/receive any styles from Excel. Browser sees no background, no font color and no bold.
There were 2 exceptions however:
- IE - original TC seems to be confirmed for IE8-11. When you paste table with CRRL+V styles are present but when you do the same with pasteFromWord they are removed so IE works partially.
- FF on Mac with
allowedContent:true
- you could actually see background color but this was because together with table, style tag (which contained this style for td) was pasted.
After checking this I think this is a 'won't fix' issue.
comment:20 Changed 11 years ago by
We may keep this ticket opened for future reference, especially considering that at least on IE there is a bit more information available so we may try to use it.
comment:21 Changed 11 years ago by
especially considering that at least on IE there is a bit more information available so we may try to use it.
Yes, exactly. IE is the only browser that sees some information so we may try to make it support Excel fully.
comment:22 Changed 9 years ago by
Keywords: | Can't Fix added |
---|---|
Resolution: | → wontfix |
Status: | confirmed → closed |
Ok, this is quite an old issue but it is time to update and close it.
IE8-11 and CKEditor 4.x work very nice with Excel. This is because IE has all the information about styles used.
Blink and Firefox only receive Raw HTML without any styling (well there is width but no info about color and border is set to none). Until Browser Vendors read that data, wan't cannot do anything to fix this.
comment:23 Changed 9 years ago by
Keywords: | CantFix added; Can't Fix removed |
---|
Using 'Ctrl+V' works only for IE8. For other browsers it doesn't work as well.