Index: plugins/htmldataprocessor/plugin.js
===================================================================
--- plugins/htmldataprocessor/plugin.js (revision 3794)
+++ plugins/htmldataprocessor/plugin.js (working copy)
@@ -249,6 +249,15 @@
{
data = data.replace( regexes[i], function( match )
{
+ match = match.replace( /<\!--{(.*?)}(.*?)-->/g, // Restore the inner text (#3869).
+ function( a, marker, comment )
+ {
+ return ( "{" + marker + "}" == protectedSourceMarker ) ?
+ decodeURIComponent( comment )
+ :
+ comment;
+ }
+ );
return '';
});
}
Index: tests/plugins/htmldataprocessor/htmldataprocessor.html
===================================================================
--- tests/plugins/htmldataprocessor/htmldataprocessor.html (revision 3794)
+++ tests/plugins/htmldataprocessor/htmldataprocessor.html (working copy)
@@ -270,7 +270,34 @@
dataProcessor.toDataFormat( protectedHtml ) );
},
+ test_ticket_3869_1 : function()
+ {
+ var editor = CKEDITOR.instances.editor1,
+ dataProcessor = editor.dataProcessor;
+ dataProcessor.writer = new CKEDITOR.htmlParser.basicWriter();
+ var html = getTextAreaValue( '_TEXTAREA_3869_1' );
+ var protectedHtml = dataProcessor.toHtml( html );
+
+ assert.areSame( html , dataProcessor.toDataFormat( protectedHtml ) );
+ },
+
+ test_ticket_3869_2 : function()
+ {
+ var editor = CKEDITOR.instances.editor1,
+ dataProcessor = editor.dataProcessor,
+ config = editor.config;
+
+ config.protectedSource.push( /<\?[\s\S]*?\?>/g ); // PHP Code
+ config.protectedSource.push( /<%[\s\S]*?%>/g ); // ASP Code
+ config.protectedSource.push( /(]+>[\s|\S]*?<\/asp:[^\>]+>)|(]+\/>)/gi ); // ASP.Net Code
+ dataProcessor.writer = new CKEDITOR.htmlParser.basicWriter();
+ var html = getTextAreaValue( '_TEXTAREA_3869_2' );
+ var protectedHtml = dataProcessor.toHtml( html );
+
+ assert.areSame( html , dataProcessor.toDataFormat( protectedHtml ) );
+ },
+
name : document.title
};
})() );
@@ -290,5 +317,15 @@
+
+