JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.4
[ckeditor.git] / _source / core / dom / walker.js
index 3d19425..a9c4eba 100644 (file)
@@ -446,7 +446,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                };\r
        };\r
 \r
-       CKEDITOR.dom.walker.bogus = function( type, isReject )\r
+       CKEDITOR.dom.walker.bogus = function( isReject )\r
        {\r
                function nonEmpty( node )\r
                {\r
@@ -455,11 +455,17 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                return function( node )\r
                {\r
-                       var parent = node.getParent(),\r
-                               isBogus = !CKEDITOR.env.ie ? node.is && node.is( 'br' ) :\r
+                       var isBogus = !CKEDITOR.env.ie ? node.is && node.is( 'br' ) :\r
                                          node.getText && tailNbspRegex.test( node.getText() );\r
 \r
-                       isBogus = isBogus && parent.isBlockBoundary() && !!parent.getLast( nonEmpty );\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