\r
var beginWhitespaceRegex = /^[\r\n\t ]+$/,\r
// Ignore bookmark nodes.(#3783)\r
- bookmarkGuard = CKEDITOR.dom.walker.bookmark( false, true );\r
+ bookmarkGuard = CKEDITOR.dom.walker.bookmark( false, true ),\r
+ whitespacesGuard = CKEDITOR.dom.walker.whitespaces( true ),\r
+ skipGuard = function( node ) { return bookmarkGuard( node ) && whitespacesGuard( node ); };\r
\r
// Get a reference for the next element, bookmark nodes are skipped.\r
function getNextSourceNode( node, startFromSibling, lastNode )\r
// to close the range, otherwise we include the parent within it.\r
if ( range && !closeRange )\r
{\r
- while ( !currentNode.getNext( bookmarkGuard ) && !isLast )\r
+ while ( !currentNode.getNext( skipGuard ) && !isLast )\r
{\r
var parentNode = currentNode.getParent();\r
\r
&& !parentPre && { br : 1 } ) )\r
{\r
closeRange = 1;\r
+ includeNode = 0;\r
isLast = isLast || ( parentNode.equals( lastNode) );\r
+ // Make sure range includes bookmarks at the end of the block. (#7359)\r
+ range.setEndAt( parentNode, CKEDITOR.POSITION_BEFORE_END );\r
break;\r
}\r
\r