/*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
(function()\r
{\r
+ function forceHtmlMode( evt ) { evt.data.mode = 'html'; }\r
+\r
CKEDITOR.plugins.add( 'pastefromword',\r
{\r
init : function( editor )\r
var resetFromWord = function( evt )\r
{\r
evt && evt.removeListener();\r
+ editor.removeListener( 'beforePaste', forceHtmlMode );\r
forceFromWord && setTimeout( function() { forceFromWord = 0; }, 0 );\r
};\r
\r
canUndo : false,\r
exec : function()\r
{\r
+ // Ensure the received data format is HTML and apply content filtering. (#6718)\r
forceFromWord = 1;\r
- if ( editor.execCommand( 'paste' ) === false )\r
+ editor.on( 'beforePaste', forceHtmlMode );\r
+\r
+ if ( editor.execCommand( 'paste', 'html' ) === false )\r
{\r
editor.on( 'dialogShow', function ( evt )\r
{\r