+ var whitespaces = CKEDITOR.dom.walker.whitespaces(),\r
+ bookmarks = CKEDITOR.dom.walker.bookmark(),\r
+ nonEmpty = function( node ){ return !( whitespaces( node ) || bookmarks( node ) ); };\r
+\r
+ function cleanUpDirection( element )\r
+ {\r
+ var dir, parent, parentDir;\r
+ if ( ( dir = element.getDirection() ) )\r
+ {\r
+ parent = element.getParent();\r
+ while ( parent && !( parentDir = parent.getDirection() ) )\r
+ parent = parent.getParent();\r
+\r
+ if ( dir == parentDir )\r
+ element.removeAttribute( 'dir' );\r
+ }\r
+ }\r
+\r