Opened 6 months ago

Last modified 5 weeks ago

#16454 confirmed Bug

Pasted plain text should have the same format where it is pasted in CKEditor

Reported by: Mingjie Owned by:
Priority: Normal Milestone:
Component: Core : Pasting Version: 4.5.0
Keywords: Cc:

Description

Steps to reproduce

  1. Go to http://ckeditor.com/demo, choose standard editor.
  2. Copy some plain text from text editor, such as notepad or notepad++, and paste using Ctrl+V or Paste button inside some existing text which has a format, such as bold, italic, underline, strikethrough, or any combinations.
  3. Notice the pasted text is remain plain text without any format, except using Ctrl+V in Chrome, it does not work using paste button in Chrome, or either case in FF or IE.

Expected result

The pasted text should have the same format where it is pasted in CKEditor.

Actual result

The pasted text does not have the same format where it is pasted in CKEditor.

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

CKEditor Version: CKEditor 4.5.11 as in CKEditor Demo Testing matrix:

Browser Ctrl+V Paste Button
Chrome 53.0 Yes No
FF 45.2 No No
IE11 No No

Attachments (1)

Paste.png (144.6 KB) - added by Mingjie 6 months ago.

Download all attachments as: .zip

Change History (4)

Changed 6 months ago by Mingjie

comment:1 Changed 5 months ago by Tade0

  • Status changed from new to pending

Unable to reproduce in Chrome 54. Does the problem persist for you in this version as well?

comment:2 Changed 4 months ago by j.swiderski

  • Keywords Pasting removed
  • Status changed from pending to confirmed
  • Version changed from 4.5.11 to 4.5.0

I have been able to reproduce the problem but I think the real problem is that Ctrl+V doesn't paste unstyled content while it should.

The default content type is dependent from this property http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-clipboard_defaultContentType and it is set to HTML by default. With such setting, pasting plain text into e.g. <strong>test</strong> should split strong tag in two and this is happening until version 4.4.8. Starting from version 4.5.0 Ctrl+V, no longer splits text.


@Mingjie if you want to have contextual pasting, please change defaultContentType to text.


It turns out we have quite a few issues with pasting and they all may be related as they all can be reproduced from 4.5.0:
Styles Stripping: #13860, #13926, #14250, #14358
Styles stripping on Chrome in various test cases: #14921, #14593, #13753, #13751, #16454
ForcePasteAsPlainText pastes formatted HTML with Ctrl+V: #13969
Weird event pasting relation (not sure): #13763
White spaces not preserved: #14614
Problem with pasting in LibreOffice: #14622 (we do not support it but I have added this issue because general solution might also bring back old behaviour).

Last edited 5 weeks ago by j.swiderski (previous) (diff)

comment:3 Changed 2 months ago by j.swiderski

#14912 was marked as duplictae.

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy