X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ffind%2Fdialogs%2Ffind.js;h=b6b2d450358f610b0b0581b23e6489b7284e4818;hb=refs%2Ftags%2Fv3.6.6;hp=d8451669404785e5d6949ca89c55f3934bb1392b;hpb=e73319a12b56100b29ef456fd74114fe5519e01c;p=ckeditor.git diff --git a/_source/plugins/find/dialogs/find.js b/_source/plugins/find/dialogs/find.js index d845166..b6b2d45 100644 --- a/_source/plugins/find/dialogs/find.js +++ b/_source/plugins/find/dialogs/find.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -155,7 +155,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( this._.matchWord && !currentTextNode || this._.walker._.end ) break; - } + } // Found a fresh text node. this.textNode = currentTextNode; if ( currentTextNode ) @@ -495,8 +495,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license tail = cursors[ cursors.length - 1 ], head = cursors[ 0 ]; - var headWalker = new characterWalker( getRangeBeforeCursor( head ), true ), - tailWalker = new characterWalker( getRangeAfterCursor( tail ), true ); + var rangeBefore = getRangeBeforeCursor( head ), + rangeAfter = getRangeAfterCursor( tail ); + + // The word boundary checks requires to trim the text nodes. (#9036) + rangeBefore.trim(); + rangeAfter.trim(); + + var headWalker = new characterWalker( rangeBefore, true ), + tailWalker = new characterWalker( rangeAfter, true ); if ( ! ( isWordSeparator( headWalker.back().character ) && isWordSeparator( tailWalker.next().character ) ) )