JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.2
[ckeditor.git] / _source / plugins / htmldataprocessor / plugin.js
index ad6fa47..8aad224 100644 (file)
@@ -44,14 +44,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        typeof extendEmptyBlock == 'function' && ( extendEmptyBlock( block ) === false ) ) )\r
                        return false;\r
 \r
-        // 1. For IE version >=8,  empty blocks are displayed correctly themself in wysiwiyg;\r
-        // 2. For the rest, at least table cell and list item need no filler space.\r
-        // (#6248)\r
-        if ( fromSource && CKEDITOR.env.ie &&\r
-                ( document.documentMode > 7\r
-                || block.name in CKEDITOR.dtd.tr\r
-                || block.name in CKEDITOR.dtd.$listItem ) )\r
-            return false;\r
+       // 1. For IE version >=8,  empty blocks are displayed correctly themself in wysiwiyg;\r
+       // 2. For the rest, at least table cell and list item need no filler space.\r
+       // (#6248)\r
+       if ( fromSource && CKEDITOR.env.ie &&\r
+               ( document.documentMode > 7\r
+                       || block.name in CKEDITOR.dtd.tr\r
+                       || block.name in CKEDITOR.dtd.$listItem ) )\r
+               return false;\r
 \r
                var lastChild = lastNoneSpaceChild( block );\r
 \r
@@ -289,7 +289,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
        }\r
 \r
        var protectElementRegex = /<(a|area|img|input)\b([^>]*)>/gi,\r
-               protectAttributeRegex = /\b(href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi;\r
+               protectAttributeRegex = /\b(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi;\r
 \r
        var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,\r
                encodedElementsRegex = /<cke:encoded>([^<]*)<\/cke:encoded>/gi;\r
@@ -305,8 +305,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                {\r
                        return '<' +  tag + attributes.replace( protectAttributeRegex, function( fullAttr, attrName )\r
                        {\r
+                               // Avoid corrupting the inline event attributes (#7243).\r
                                // We should not rewrite the existed protected attributes, e.g. clipboard content from editor. (#5218)\r
-                               if ( attributes.indexOf( 'data-cke-saved-' + attrName ) == -1 )\r
+                               if ( !( /^on/ ).test( attrName ) && attributes.indexOf( 'data-cke-saved-' + attrName ) == -1 )\r
                                        return ' data-cke-saved-' + fullAttr + ' ' + fullAttr;\r
 \r
                                return fullAttr;\r