Ticket #3710: 3710.patch
File 3710.patch, 1.4 KB (added by , 15 years ago) |
---|
-
_source/plugins/htmldataprocessor/plugin.js
191 191 return html.replace( protectAttributeRegex, '$& _cke_saved_$1' ); 192 192 } 193 193 194 var protectStyleTagsRegex = /(<\/?)style(?=[^0-9A-Za-z])/gi; 195 var unprotectStyleTagsRegex = /(<\/?)cke:style(?=[^0-9A-Za-z])/gi; 196 194 197 CKEDITOR.plugins.add( 'htmldataprocessor', 195 198 { 196 199 requires : [ 'htmlwriter' ], … … 227 230 // the code. 228 231 data = protectAttributes( data ); 229 232 233 // IE remvoes style tags from innerHTML. (#3710). 234 if ( CKEDITOR.env.ie ) 235 data = data.replace( protectStyleTagsRegex, '$1cke:style' ); 236 230 237 // Call the browser to help us fixing a possibly invalid HTML 231 238 // structure. 232 239 var div = document.createElement( 'div' ); 233 240 div.innerHTML = data; 241 data = div.innerHTML; 234 242 243 if ( CKEDITOR.env.ie ) 244 data = data.replace( unprotectStyleTagsRegex, '$1style' ); 245 235 246 // Now use our parser to make further fixes to the structure, as 236 247 // well as apply the filter. 237 var fragment = CKEDITOR.htmlParser.fragment.fromHtml( d iv.innerHTML, fixForBody ),248 var fragment = CKEDITOR.htmlParser.fragment.fromHtml( data, fixForBody ), 238 249 writer = new CKEDITOR.htmlParser.basicWriter(); 239 250 240 251 fragment.writeHtml( writer, this.dataFilter );