X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Fdom%2Fwalker.js;h=a9c4ebacb5b4cb0beacff21d490918e7fda39628;hp=3d1942596e51d4ce96278d36bdd155fdf396fe30;hb=6e682412d5cc0dfaedb376482e585bf2989c6863;hpb=2f22c0c38f17e75be5541089076885442aaa2377 diff --git a/_source/core/dom/walker.js b/_source/core/dom/walker.js index 3d19425..a9c4eba 100644 --- a/_source/core/dom/walker.js +++ b/_source/core/dom/walker.js @@ -446,7 +446,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }; }; - CKEDITOR.dom.walker.bogus = function( type, isReject ) + CKEDITOR.dom.walker.bogus = function( isReject ) { function nonEmpty( node ) { @@ -455,11 +455,17 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return function( node ) { - var parent = node.getParent(), - isBogus = !CKEDITOR.env.ie ? node.is && node.is( 'br' ) : + var isBogus = !CKEDITOR.env.ie ? node.is && node.is( 'br' ) : node.getText && tailNbspRegex.test( node.getText() ); - isBogus = isBogus && parent.isBlockBoundary() && !!parent.getLast( nonEmpty ); + if ( isBogus ) + { + var parent = node.getParent(), next = node.getNext( nonEmpty ); + isBogus = parent.isBlockBoundary() && + ( !next || + next.type == CKEDITOR.NODE_ELEMENT && + next.isBlockBoundary() ); + } return !! ( isReject ^ isBogus ); };