Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

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

Version: 4.1
  1. Is mainly invalid. The dialog has to be opened to grab the content unless ctrl+v (for rich content) or ctrl+shift+v (for plain text content - but only on some browsers) is pressed. Browsers do not allow to access the clipboard content in other ways. So if you want to have rich content pasting working it has to be bound to ctrl+v or you would need to use paste dialog.
  1. Content pasted with shift+insert isn't fully catchable iirc. Although, I would need to debug this because I might be mistaken, but I'm not planning to work on clipboard handling for longer period.

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.

comment:2 Changed 11 years ago by Jakub Ś

Status: newpending

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 in reply to:  2 Changed 11 years ago by vijendra

Steps to repro issue:

  1. Open IE 8/9/10
  2. Go to CKEditor site and open the Standard version of CKEditor (http://ckeditor.com/demo#standard)
  3. Open notepad and type text, it should have multiline spaces example

"Testing



Testing

Testing

Testing"

  1. Copy the text from the notepad using Ctrl + A, Ctrl + C
  2. 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 11 years ago by Jakub Ś

Resolution: invalid
Status: pendingclosed

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

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

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy