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