// Intercept the default pasting process.\r
editor.on( 'beforeCommandExec', function ( evt )\r
{\r
- if ( evt.data.name == 'paste' )\r
+ var mode = evt.data.commandData;\r
+ // Do NOT overwrite if HTML format is explicitly requested.\r
+ if ( evt.data.name == 'paste' && mode != 'html' )\r
{\r
editor.execCommand( 'pastetext' );\r
evt.cancel();\r
}\r
}, null, null, 0 );\r
+\r
+ editor.on( 'beforePaste', function( evt )\r
+ {\r
+ evt.data.mode = 'text';\r
+ });\r
}\r
\r
editor.on( 'pasteState', function( evt )\r
* Whether to force all pasting operations to insert on plain text into the\r
* editor, loosing any formatting information possibly available in the source\r
* text.\r
+ * <strong>Note:</strong> paste from word is not affected by this configuration.\r
* @name CKEDITOR.config.forcePasteAsPlainText\r
* @type Boolean\r
* @default false\r