#10387 closed Bug (invalid)
Pasting in CKEditor with Crtl + Shift + V or Shift + Insert
Reported by: | vijendra | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Hi,
There are basically 2 things I am seeking help from you. The 1 is kind of RFE\New Feature request, but the 2 is a Bug.
1#
We have configured Paste as plain text as the default setting (config.forcePasteAsPlainText = true;). However we would also like to provide option to Paste with Source Formatting(preserving the formatting). Because many time, the users copy content from the editor itself and pastes it back to the editor, but while pasting all their formatting gets lost. So we wanted to avoid such scenario. We tried using
config.keystrokes = [ [CKEDITOR.CTRL + 86, 'pastetext'], [CKEDITOR.CTRL + CKEDITOR.SHIFT + 86, 'paste'] ];
But the issue here is, it opens up popup dialog which we want to avoid. And in Chrome, the content gets pasted twice(1st by pressing Ctrl + Shift + V and 2nd through the Popup dialog.)
So how can we provide both the option (Ctrl + V => Paste as Plain Text and Ctrl + Shift + V => Paste with Source Formatting), cleanly without showing any kind of popup dialog.
2#
One minor issue we observed is, pasting text in IE 8/9/10 using Shift + Insert removes extra line spaces, with config.forcePasteAsPlainText = true;, the same thing works perfect when pasted on IE 8/9/10 using Ctrl + V. Chrome and FF works correctly though for both Ctrl + V and Shift + Insert.
Any help would be appreciated.
Thanks in advance.
Change History (5)
comment:1 Changed 12 years ago by
Version: | 4.1 |
---|
comment:2 follow-up: 3 Changed 12 years ago by
Status: | new → pending |
---|
I was not able to reproduce this problem.
pasting text in IE 8/9/10 using Shift + Insert removes extra line spaces, with config.forcePasteAsPlainText = true;,
Please describe exactly in step by step scenario what you are trying to paste, from where (extranal page or editor) etc. Please provide file with contents to paste. More information you give us the better we will be able to determine if this is editor bug or not
comment:3 Changed 12 years ago by
Steps to repro issue:
- Open IE 8/9/10
- Go to CKEditor site and open the Standard version of CKEditor (http://ckeditor.com/demo#standard)
- Open notepad and type text, it should have multiline spaces example
"Testing
Testing
Testing
Testing"
- Copy the text from the notepad using Ctrl + A, Ctrl + C
- Now try pasting the content in CKEditor using Shift + Insert, you can see that the multiline spaces gets trimmed.
Hope this helps you.
-Vijendra
Replying to j.swiderski:
I was not able to reproduce this problem.
pasting text in IE 8/9/10 using Shift + Insert removes extra line spaces, with config.forcePasteAsPlainText = true;,
Please describe exactly in step by step scenario what you are trying to paste, from where (extranal page or editor) etc. Please provide file with contents to paste. More information you give us the better we will be able to determine if this is editor bug or not
comment:4 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
I have tried in Standard demo, then in local editor with forcePasteAsPlainText set to true and result was the same with Shift+Insert and Ctrl+V.
Then I have noticed we have been discussing something similar in #9753. Outcome is the same as in comment-10. Yes you get few spaces removed but this is by design:
When you paste text like this from notepad it gets pasted as single p (One enter from notepad gets changed to br. Two enters from notepad get changed to p - this was unified in CKEditor 4).
I'm closing this ticket as invalid. Feel free to leave your comments if you think otherwise. If I have missed something please leave a comment as well and I will reopen this issue.
comment:5 Changed 12 years ago by
@vijendra if you don't agree please provide screen cast or screen shots presenting this problem. Please also explain how many spaces you have in notepad and how many are left in editor.
I see that you should use Advanced Content Filter. When properly configured it will filter pasted content according to what is allowed and you won't need the forcePasteAsPlainText option at all. In fact, that's why we removed it from basic preset config.