Opened 4 years ago

Last modified 4 years ago

#12764 confirmed Bug

Pasting pure text in Chrome causes weird results

Reported by: Wiktor Walc Owned by:
Priority: Normal Milestone:
Component: Core : Pasting Version: 4.0
Keywords: Support Cc: mike@…

Description (last modified by Wiktor Walc)

  1. Open a sample with ACF disabled (e.g. the magicline sample).
  1. Paste the following in source mode:
<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
  <tbody>
    <tr>
      <td style="color: #5f2351; font-size: 18pt;">
        Hello &amp; welcome to K-talk
      </td>
    </tr>
  </tbody>
</table>

  1. Switch to WYSIWYG mode.
  1. Copy "Test paste" string from some plain text editor (e.g. Notepad on Windows)
  1. Place the cursor at the end of the text and press the keyboard shortcut to paste (CTRL + V).
  1. The result is (wrong):
    <table border="0" cellpadding="0" cellspacing="0" style="width:100%">
      <tbody>
        <tr>
          <td style="color: #5f2351; font-size: 18pt;">
            <font color="#666666">
              <span style="font-size:10px">
                Hello &amp; welcome to K-talk
              </span>
            </font>
            Test paste
          </td>
        </tr>
      </tbody>
    </table>
    

  1. However, if you paste the same content using the "Paste" button in CKEditor, the result is different (correct!):
    <table border="0" cellpadding="0" cellspacing="0" style="width:100%">
      <tbody>
        <tr>
          <td style="color: #5f2351; font-size: 18pt;">
            Hello &amp; welcome to K-talkTest paste
          </td>
        </tr>
      </tbody>
    </table>
    


Confirmed on Google Chrome (Win, Linux, Mac), happens in CKEditor 4.0 - 4.4.6. Works fine on CKEditor 3.6.6.2 and on plain contenteditable.

I couldn't find any other markup different than tables that would cause similar issues.

Attachments (5)

step3.png (4.2 KB) - added by Wiktor Walc 4 years ago.
step6.png (3.6 KB) - added by Wiktor Walc 4 years ago.
step7.png (5.3 KB) - added by Wiktor Walc 4 years ago.
example.mov (776.3 KB) - added by Wiktor Walc 4 years ago.
contenteditable.html (463 bytes) - added by Wiktor Walc 4 years ago.

Download all attachments as: .zip

Change History (11)

Changed 4 years ago by Wiktor Walc

Attachment: step3.png added

Changed 4 years ago by Wiktor Walc

Attachment: step6.png added

Changed 4 years ago by Wiktor Walc

Attachment: step7.png added

Changed 4 years ago by Wiktor Walc

Attachment: example.mov added

comment:1 Changed 4 years ago by Wiktor Walc

Description: modified (diff)

Changed 4 years ago by Wiktor Walc

Attachment: contenteditable.html added

comment:2 Changed 4 years ago by Wiktor Walc

Status: newconfirmed

comment:3 Changed 4 years ago by Wiktor Walc

Description: modified (diff)

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

This is an absurd... Those inline elements are created by Chrome and I lack imagination to understand why. They are created when the selection isn't even in the table, because for the process of pasting we move the selection to the pastebin which is outside of the table. But even if we accept that on CTRL+V the selection is in that table... this is still ridiculous - what those elements are meant to do?

This issue will be fixed in 4.5 when we stop letting Chrome do anything by intercepting the paste event.

comment:5 Changed 4 years ago by Wiktor Walc

Keywords: Support added

comment:6 Changed 4 years ago by Mike Burgh

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