delete blockLikeTags.pre;\r
var defaultDataFilterRules =\r
{\r
+ elements : {},\r
attributeNames :\r
[\r
// Event attributes (onXYZ) must not be directly set. They can become\r
}\r
},\r
\r
+ html : function( element )\r
+ {\r
+ delete element.attributes.contenteditable;\r
+ delete element.attributes[ 'class' ];\r
+ },\r
+\r
body : function( element )\r
{\r
delete element.attributes.spellcheck;\r
\r
title : function( element )\r
{\r
- element.children[ 0 ].value = element.attributes[ '_cke_title' ];\r
+ var titleText = element.children[ 0 ];\r
+ titleText && ( titleText.value = element.attributes[ '_cke_title' ] || '' );\r
}\r
},\r
\r
};\r
}\r
\r
- var protectAttributeRegex = /<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi;\r
+ function protectReadOnly( element )\r
+ {\r
+ element.attributes.contenteditable = "false";\r
+ }\r
+ function unprotectReadyOnly( element )\r
+ {\r
+ delete element.attributes.contenteditable;\r
+ }\r
+ // Disable form elements editing mode provided by some browers. (#5746)\r
+ for ( i in { input : 1, textarea : 1 } )\r
+ {\r
+ defaultDataFilterRules.elements[ i ] = protectReadOnly;\r
+ defaultHtmlFilterRules.elements[ i ] = unprotectReadyOnly;\r
+ }\r
+\r
+ var protectAttributeRegex = /<((?:a|area|img|input)[\s\S]*?\s)((href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))([^>]*)>/gi,\r
+ findSavedSrcRegex = /\s_cke_saved_src\s*=/;\r
\r
var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,\r
encodedElementsRegex = /<cke:encoded>([^<]*)<\/cke:encoded>/gi;\r
\r
function protectAttributes( html )\r
{\r
- return html.replace( protectAttributeRegex, '$& _cke_saved_$1' );\r
+ return html.replace( protectAttributeRegex, function( tag, beginning, fullAttr, attrName, end )\r
+ {\r
+ // We should not rewrite the _cke_saved_src attribute (#5218)\r
+ if ( attrName == 'src' && findSavedSrcRegex.test( tag ) )\r
+ return tag;\r
+ else\r
+ return '<' + beginning + fullAttr + ' _cke_saved_' + fullAttr + end + '>';\r
+ });\r
}\r
\r
function protectElements( html )\r