Ticket #3801: 3801_4.patch
File 3801_4.patch, 4.4 KB (added by , 15 years ago) |
---|
-
CHANGES.html
78 78 <li><a href="http://dev.fckeditor.net/ticket/3829">#3829</a> : Fixed remove empty link on output data.</li> 79 79 <li><a href="http://dev.fckeditor.net/ticket/3730">#3730</a> : Indent is performing on the whole 80 80 block instead of selected lines in enterMode = BR.</li> 81 <li><a href="http://dev.fckeditor.net/ticket/3801">#3801</a> : Comments at the start of the document was lost in IE.</li> 81 82 </ul> 82 83 <h3> 83 84 CKEditor 3.0 RC</h3> -
_source/plugins/htmldataprocessor/plugin.js
195 195 return html.replace( protectAttributeRegex, '$& _cke_saved_$1' ); 196 196 } 197 197 198 var protect StyleTagsRegex = /<(style)(?=[ >])[^>]*>[^<]*<\/\1>/gi;198 var protectTagsRegex = /<(style)(?=[ >])[^>]*>[^<]*<\/\1>|<!--([\s\S]*?)-->/gi; 199 199 var encodedTagsRegex = /<cke:encoded>([^<]*)<\/cke:encoded>/gi; 200 200 var protectElementNamesRegex = /(<\/?)((?:object|embed|param).*?>)/gi; 201 201 var protectSelfClosingRegex = /<cke:param(.*?)\/>/gi; 202 202 203 function protect StyleTagsMatch( match )203 function protectTagsMatch( match ) 204 204 { 205 205 return '<cke:encoded>' + encodeURIComponent( match ) + '</cke:encoded>'; 206 206 } 207 207 208 function protect StyleTags( html )208 function protectTags( html ) 209 209 { 210 return html.replace( protect StyleTagsRegex, protectStyleTagsMatch );210 return html.replace( protectTagsRegex, protectTagsMatch ); 211 211 } 212 212 function protectElementsNames( html ) 213 213 { … … 296 296 // the code. 297 297 data = protectAttributes( data ); 298 298 299 // IE remvoes style tags from innerHTML. (#3710).299 // IE remvoes style tags an comments from innerHTML. (#3710 & ...). 300 300 if ( CKEDITOR.env.ie ) 301 data = protect StyleTags( data );301 data = protectTags( data ); 302 302 303 303 // Certain elements has problem to go through DOM operation, protect 304 304 // them by prefixing 'cke' namespace.(#3591) … … 310 310 311 311 // Call the browser to help us fixing a possibly invalid HTML 312 312 // structure. 313 var div = document.createElement( 'div' ); 314 div.innerHTML = data; 315 data = div.innerHTML; 313 // var div = document.createElement( 'div' ); 314 var div = new CKEDITOR.dom.element( 'div' ); 315 div.setHtml( data ); 316 data = div.getHtml(); 316 317 317 318 if ( CKEDITOR.env.ie ) 318 319 data = unprotectEncodedTags( data ); -
_source/tests/plugins/htmldataprocessor/htmldataprocessor.html
270 270 dataProcessor.toDataFormat( protectedHtml ) ); 271 271 }, 272 272 273 test_innerHtmlComments_ticket_3801 : function() 274 { 275 var editor = CKEDITOR.instances.editor1, 276 dataProcessor = editor.dataProcessor; 273 277 278 dataProcessor.writer = new CKEDITOR.htmlParser.basicWriter(); 279 280 for ( var i = 1; i <= 6; i++ ) 281 { 282 var html = getTextAreaValue( '_TEXTAREA_3801_' + i ); 283 var protectedHtml = dataProcessor.toHtml( html ); 284 285 assert.areSame( getTextAreaValue( '_TEXTAREA_3801_' + i ), 286 dataProcessor.toDataFormat( protectedHtml ) ); 287 } 288 }, 289 290 274 291 name : document.title 275 292 }; 276 293 })() ); … … 290 307 <textarea id="_TEXTAREA_3591"><object><param /><param /><embed></embed></object></textarea> 291 308 <textarea id="_TEXTAREA_3591_protected"><cke:object><cke:param></cke:param><cke:param></cke:param><cke:embed></cke:embed></cke:object></textarea> 292 309 <textarea id="_TEXTAREA_3591_2"><object classid="clsid"><param name="movie" value="movie.swf" /><embed src="movie.swf" type="application/x-shockwave-flash"></embed></object></textarea> 310 <textarea id="_TEXTAREA_3801_1"><!-- foo --><p>bar</p></textarea> 311 <textarea id="_TEXTAREA_3801_2"><p><!-- foo -->bar</p></textarea> 312 <textarea id="_TEXTAREA_3801_3"><!-- foo --><p><!-- foo -->bar</p></textarea> 313 <textarea id="_TEXTAREA_3801_4"><p>bar</p><!-- foo --></textarea> 314 <textarea id="_TEXTAREA_3801_5">bar<!-- foo --></textarea> 315 <textarea id="_TEXTAREA_3801_6"><!-- foo -->bar</textarea> 293 316 </body> 294 317 </html>