Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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

  1. 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>

  1. In CKEditor, click the 'Source' button, and paste fragment,
  2. Switch back to rich text mode, and observe empty paragraph with non-breakspace :
  1. 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>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</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)

EmbeddedArtifacts_SCR2.PNG (131.9 KB) - added by Christophe Guillou 4 years ago.
EmbeddedArtifacts_SCR2.2.PNG (131.9 KB) - added by Christophe Guillou 4 years ago.
EmbeddedArtifacts_SCR1.PNG (128.8 KB) - added by Christophe Guillou 4 years ago.
nbsp-bug.mov (2.8 MB) - added by Piotrek Koszuliński 4 years ago.
Difference_ClipboardData_Pasting source tab.png (76.3 KB) - added by Christophe Guillou 4 years ago.

Change History (19)

comment:1 Changed 4 years ago by Piotrek Koszuliński

Status: newpending
Version: 4.4.8

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.

Changed 4 years ago by Christophe Guillou

Attachment: EmbeddedArtifacts_SCR2.PNG added

Changed 4 years ago by Christophe Guillou

Changed 4 years ago by Christophe Guillou

Attachment: EmbeddedArtifacts_SCR1.PNG added

comment:2 Changed 4 years ago by Christophe Guillou

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>&nbsp;</span>) :

<table border="1" cellpadding="1" cellspacing="1" dir="ltr" style="width:500px">
    <tbody>
        <tr>
            <td style="width: 500px;"><span>&nbsp;&nbsp;</span>sample testing<span> &nbsp;</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>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</p>

<table border="1" cellpadding="1" cellspacing="1" dir="ltr" style="width:500px">
	<tbody>
		<tr>
			<td style="width:500px">&nbsp;&nbsp;sample testing &nbsp;</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 4 years ago by Piotrek Koszuliński

Attachment: nbsp-bug.mov added

comment:3 Changed 4 years ago by Piotrek Koszuliński

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.

Last edited 4 years ago by Piotrek Koszuliński (previous) (diff)

comment:4 Changed 4 years ago by Piotrek Koszuliński

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 4 years ago by Piotrek Koszuliński

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 4 years ago by Jakub Ś

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 4 years ago by Christophe Guillou

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 4 years ago by Jakub Ś

Resolution: invalid
Status: pendingclosed

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 4 years ago by Jakub Ś

@cguillou, we are of course interested which plugin it is. If you find it, please let us know.

Changed 4 years ago by Christophe Guillou

comment:10 Changed 4 years ago by Christophe Guillou

Cc: ChrisGui@… added
Type: BugTask

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 4 years ago by Christophe Guillou

Type: TaskBug

comment:12 Changed 4 years ago by Christophe Guillou

In previous screenshot I copied the source html fragment from Rational - the piece of source code is taken as Rich Text as opposed to plain text, and although the text can be retrieved properly from the clipboard, the interpretation as by CK as Rich Text introduces a lot of bad chars -eg.  and this messes up the rendering.

Last edited 4 years ago by Christophe Guillou (previous) (diff)

comment:13 Changed 4 years ago by Jakub Ś

@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 4 years ago by Anna Tomanek

Summary: Editor strips span tags when copy&paste a table with embedded artifactsEditor strips <span> tags when copying and pasting a table with embedded artifacts
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy