#13629 closed Bug (invalid)
Editor strips <span> tags when copying and pasting a table with embedded artifacts
Reported by: | Christophe Guillou | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | IBM | Cc: | ChrisGui@… |
Description
Steps to reproduce
- copy this HTML fragment from Notepad file:
<table border="1" cellpadding="1" cellspacing="1" dir="ltr" style="width:500px">
<tbody>
<tr>
<td style="width: 500px;">dsfdsdsfds</td>
</tr>
</tbody>
</table>
- In CKEditor, click the 'Source' button, and paste fragment,
- Switch back to rich text mode, and observe empty paragraph with non-breakspace :
- Switch back to Source mode
Expected result
<table border="1" cellpadding="1" cellspacing="1" dir="ltr" style="width:500px">
<tbody>
<tr>
<td style="width: 500px;">dsfdsdsfds</td>
</tr>
</tbody>
</table>
Actual result
<p> </p>
<table border="1" cellpadding="1" cellspacing="1" dir="ltr" style="width:500px">
<tbody>
<tr>
<td style="width: 500px;">dsfdsdsfds</td>
</tr>
</tbody>
</table>
Other details (browser, OS, CKEditor version, installed plugins)
Attachments (5)
Change History (19)
comment:1 Changed 9 years ago by
Status: | new → pending |
---|---|
Version: | 4.4.8 |
Changed 9 years ago by
Attachment: | EmbeddedArtifacts_SCR2.PNG added |
---|
Changed 9 years ago by
Attachment: | EmbeddedArtifacts_SCR2.2.PNG added |
---|
Changed 9 years ago by
Attachment: | EmbeddedArtifacts_SCR1.PNG added |
---|
comment:2 Changed 9 years ago by
Hi Reinmar,
Thanks for your message, I have realized that the code fragment in description was pasted as *rich text* , and I have been able to reproduce the issue on the ckeditor.com website with the latest firefox on Windows 7(see screenshots)
if you copy the following code fragment in Source mode on the Full featured sample on ckeditor.com (note <span> </span>) :
<table border="1" cellpadding="1" cellspacing="1" dir="ltr" style="width:500px"> <tbody> <tr> <td style="width: 500px;"><span> </span>sample testing<span> </span></td> </tr> </tbody> </table>
You will be able to observe the following resolved after switching to Rich Text Mode and switching back to Source mode :
<p> </p> <table border="1" cellpadding="1" cellspacing="1" dir="ltr" style="width:500px"> <tbody> <tr> <td style="width:500px"> sample testing </td> </tr> </tbody> </table>
I have noted this does not happen with the Standard version of the Editor.
Can you please let us know what causes this issue, this has become a very high priority for one of our customers.
Thanks,
Changed 9 years ago by
Attachment: | nbsp-bug.mov added |
---|
comment:3 Changed 9 years ago by
Still, I cannot reproduce anything like this. See: http://dev.ckeditor.com/attachment/ticket/13629/nbsp-bug.mov (http://gfycat.com/SlimyFluffyBalloonfish)
Did you check this on some other machine? It's very likely that some addon is messing up with the clipboard. You can also try to listen to editor#paste with a high-prior listener to see what's there.
comment:4 Changed 9 years ago by
Oops, I've just understood that this may work differently on Windows and Mac and I'm testing on Mac. I'll check it in a minute.
comment:5 Changed 9 years ago by
Oops, I've just understood that this may work differently on Windows and Mac and I'm testing on Mac. I'll check it in a minute.
Nope. The same as on Mac. It's clean.
comment:6 Changed 9 years ago by
I have tried latest Firefox on Windows 7 with both - demo and local CKEditor. Both worked as expected.
From your tests it looks likt it is just a matter of pasting the HTML and switching modes (source->wysiwyg->source).
Could you please follow @Reinmar suggestion and check it on other machine or perhaps check it on Firefox but with Firefox custom add-ons disabled as one of them might be a reason of this behaviour.
comment:7 Changed 9 years ago by
Thanks a lot - I've just tested Reinmar's suggestion ; and the great news is that issue is gone once the Firefox Add-ons are disabled. That can only mean one of the add-on I would have installed has a knock-on impact on CK... interesting... I will try to gather some more information on this - I have Firebug installed as well as other IBM SmartCloud Add-ons for Firefox.
comment:8 Changed 9 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Thank you for the information. This is in fact the first time I see that FF plugin breaks JS application. I have seen Chrome plugins doing it many times but never have I see the FF plugin.
Unfortunately there is nothing CKEditor as JS application can do about it. The plugin needs to be fixed or disabled.
comment:9 Changed 9 years ago by
@cguillou, we are of course interested which plugin it is. If you find it, please let us know.
Changed 9 years ago by
Attachment: | Difference_ClipboardData_Pasting source tab.png added |
---|
comment:10 Changed 9 years ago by
Cc: | ChrisGui@… added |
---|---|
Type: | Bug → Task |
I have been able to reproduce the issue using Chrome when no plugins are installed. And here is the theory:
Based on what applicationthe Text is copied from, the pasting event in Source tab does not seem to enforce pasting as plain text. So the fix should be to enforce pasting as plain text if the Source tab is selected. I've got a capture of the difference that I observe in the clipboard data.
@see attachement
comment:11 Changed 9 years ago by
Type: | Task → Bug |
---|
comment:12 Changed 9 years ago by
In previous screenshot I copied the text from Rational- the piece of source code is taken as Rich Text, and although the text can be retrieved propertly from the clipboard, when the interpretation as Rich Text introduces a lot of bad chars -eg. Â
comment:13 Changed 9 years ago by
@cguillou I can see you have some sort of the problem (it doesn't have to be the one originally posted) using a tool I'm not familiar with. Can this issue be reproduced using CKEditor and some HTML page (or whatever is needed to reproduce it) from which content can be copied?
Could you also check if encoding, in test you have performed, is consistent? I'm asking because when there is 'Â' reported with French name next to it, so far in 100% cases this was because of encoding.
I'm not sure how your tool works but if it involves server-side, could you perhaps check if encoding is first of all consistent and if this is UTF-8?
Finally could you just in case check this issue in Chrome with incognito mode enabled just to make sure that no Chrome feature is interfering.
comment:14 Changed 9 years ago by
Summary: | Editor strips span tags when copy&paste a table with embedded artifacts → Editor strips <span> tags when copying and pasting a table with embedded artifacts |
---|
I cannot reproduce anything like this. Are you able to reproduce it on one of the official samples? And on which browser? Please make sure that you're able to reproduce it on other machine too, because sometimes an odd content can be created by stuff like antiviruses or browser addons.