- // Reject any text node unless it's being bookmark\r
- // OR it's spaces. (#3883)\r
- return node.type != CKEDITOR.NODE_TEXT\r
- && node.getName() in CKEDITOR.dtd.$removeEmpty\r
- || !CKEDITOR.tools.trim( node.getText() )\r
- || !!node.getParent().data( 'cke-bookmark' );\r
+ return function( node )\r
+ {\r
+ // Tolerant bogus br when checking at the end of block.\r
+ // Reject any text node unless it's being bookmark\r
+ // OR it's spaces.\r
+ // Reject any element unless it's being invisible empty. (#3883)\r
+ return !checkStart && isBogus( node ) ||\r
+ ( node.type == CKEDITOR.NODE_TEXT ?\r
+ !CKEDITOR.tools.trim( node.getText() ) || !!node.getParent().data( 'cke-bookmark' )\r
+ : node.getName() in CKEDITOR.dtd.$removeEmpty );\r
+ };\r