Index: _source/plugins/htmldataprocessor/plugin.js =================================================================== --- _source/plugins/htmldataprocessor/plugin.js (revision 3651) +++ _source/plugins/htmldataprocessor/plugin.js (working copy) @@ -5,6 +5,38 @@ (function() { + function blockNeedsExtension( block ) + { + if ( block.children.length < 1 ) + return true; + + var lastChild = block.children[ block.children.length - 1 ]; + return lastChild.type == CKEDITOR.NODE_ELEMENT && lastChild.name == 'br'; + } + + function extendBlockForDisplay( block ) + { + if ( blockNeedsExtension( block ) ) + { + if ( CKEDITOR.env.ie ) + block.children.push( new CKEDITOR.htmlParser.text( '\xa0' ) ); + else + block.children.push( new CKEDITOR.htmlParser.element( 'br', {} ) ); + } + } + + function extendBlockForOutput( block ) + { + if ( blockNeedsExtension( block ) ) + block.children.push( new CKEDITOR.htmlParser.text( '\xa0' ) ); + } + + var dtd = CKEDITOR.dtd; + + // $tableContent is replaced by two select tags because tags like tbody should + // not be extended. + var blockLikeTags = CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, { td : 1, th : 1 } ); + var defaultDataFilterRules = { elementNames : @@ -18,9 +50,14 @@ // Event attributes (onXYZ) must not be directly set. They can become // active in the editing area (IE|WebKit). [ ( /^on/ ), '_cke_pa_on' ] - ] + ], + + elements : {} }; + for ( var i in blockLikeTags ) + defaultDataFilterRules.elements[ i ] = extendBlockForDisplay; + /** * IE sucks with dynamic 'name' attribute after element is created, '_cke_saved_name' is used instead for this attribute. */ @@ -102,6 +139,9 @@ } } }; + + for ( var i in blockLikeTags ) + defaultHtmlFilterRules.elements[ i ] = extendBlockForOutput; if ( CKEDITOR.env.ie ) { Index: _source/tests/plugins/htmldataprocessor/htmldataprocessor.html =================================================================== --- _source/tests/plugins/htmldataprocessor/htmldataprocessor.html (revision 3651) +++ _source/tests/plugins/htmldataprocessor/htmldataprocessor.html (working copy) @@ -3,7 +3,9 @@