+ CKEDITOR.dom.walker.bogus = function( isReject )\r
+ {\r
+ function nonEmpty( node )\r
+ {\r
+ return !isWhitespaces( node ) && !isBookmark( node );\r
+ }\r
+\r
+ return function( node )\r
+ {\r
+ var isBogus = !CKEDITOR.env.ie ? node.is && node.is( 'br' ) :\r
+ node.getText && tailNbspRegex.test( node.getText() );\r
+\r
+ if ( isBogus )\r
+ {\r
+ var parent = node.getParent(), next = node.getNext( nonEmpty );\r
+ isBogus = parent.isBlockBoundary() &&\r
+ ( !next ||\r
+ next.type == CKEDITOR.NODE_ELEMENT &&\r
+ next.isBlockBoundary() );\r
+ }\r
+\r
+ return !! ( isReject ^ isBogus );\r
+ };\r
+ };\r
+\r
+ var tailNbspRegex = /^[\t\r\n ]*(?: |\xa0)$/,\r
+ isWhitespaces = CKEDITOR.dom.walker.whitespaces(),\r
+ isBookmark = CKEDITOR.dom.walker.bookmark(),\r
+ toSkip = function( node )\r
+ {\r
+ return isBookmark( node )\r
+ || isWhitespaces( node )\r
+ || node.type == CKEDITOR.NODE_ELEMENT\r
+ && node.getName() in CKEDITOR.dtd.$inline\r
+ && !( node.getName() in CKEDITOR.dtd.$empty );\r
+ };\r
+\r
+ // Check if there's a filler node at the end of an element, and return it.\r
+ CKEDITOR.dom.element.prototype.getBogus = function()\r
+ {\r
+ // Bogus are not always at the end, e.g. <p><a>text<br /></a></p> (#7070).\r
+ var tail = this;\r
+ do { tail = tail.getPreviousSourceNode(); }\r
+ while ( toSkip( tail ) )\r
+\r
+ if ( tail && ( !CKEDITOR.env.ie ? tail.is && tail.is( 'br' )\r
+ : tail.getText && tailNbspRegex.test( tail.getText() ) ) )\r
+ {\r
+ return tail;\r
+ }\r
+ return false;\r
+ };\r
+\r