aabhi
aabhi

Reputation: 47

CkEditor copy/Paste Implementation - copy from editor and copy from outside editor

I am trying to paste the same html if i copied from editor as well if i copied from outside editor or any other page which can be with any style while pasting into editor it comes with simple plain text.

But if i copied from my editor whatever element it has with any style like bold, bullet, link , it should be retain with same on pasting it.

For simple plain text : config.forcePasteAsPlainText = true;

for html it need to be disable mean false.

But i need both things on the condition if i copy from editor and if i copy from outside editor ...

I need a solution to give this condition on which i can write two different code as per requirement .

Please suggest the logic.

thanks

Upvotes: 1

Views: 1153

Answers (1)

Piotr Jasiun
Piotr Jasiun

Reputation: 1006

If you want to filter pasted data which comes from the outside, you can use pasteFilter, which does exactly this: http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-pasteFilter

The problem is that recognising where the data comes from works fine only in Chrome, right now. In other browsers there is no full support for the Clipboard API. There are tickets to introduce some workaround: (http://dev.ckeditor.com/ticket/12872 for Firefox) and (http://dev.ckeditor.com/ticket/12873 for IE). But for now every paste is treated as an external paste there.

Upvotes: 1

Related Questions