Hello,
I am looking to develop an simple plugin to let the user paste HTML code directly using a button like the "Paste as text".
I did not find how to get the non-formatted data, like it was possible in version 3 using evt.data.html.
I wrote something like :
editor.on( 'paste', function( evt ) {
alert(evt.data.dataValue);
}
evt.data.dataValue contains pasted code but HTML formatted.
Can anybody help me ?
Thank you,
You need to use config
You need to use config.forcePasteAsPlainText option (you need the pasteastext plugin, but most likely you have it in your CKEditor package). If you set it to true the evt.data.dataValue will contain HTML code generated for "plain text data". For example bunch of paragraphs and nothing more if your enterMode is ENTER_P.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+