Opened 8 years ago
Last modified 8 years ago
#16454 confirmed Bug
Pasted plain text should have the same format where it is pasted in CKEditor
Reported by: | Mingjie Li | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Pasting | Version: | 4.5.0 |
Keywords: | Cc: |
Description
Steps to reproduce
- Go to http://ckeditor.com/demo, choose standard editor.
- 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.
- 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)
Change History (4)
Changed 8 years ago by
comment:1 Changed 8 years ago by
Status: | new → pending |
---|
comment:2 Changed 8 years ago by
Keywords: | Pasting removed |
---|---|
Status: | pending → confirmed |
Version: | 4.5.11 → 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.
This ticket is similar to #13751 although both talk about a little bit different things. Anyway I think it is very important to fix these two tickets at the same time to cover both cases.
It seems we have quite a few issues with copy/paste and style loss - #14391, #14406, #13751, #13753, #10924, #14593, #14921, #16454.
Unable to reproduce in Chrome 54. Does the problem persist for you in this version as well?