X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Ffind%2Fdialogs%2Ffind.js;h=5f8c34214a2c11e7f2bab3f90692fddc2ff927f5;hp=a84315e9fea45c4c15f81dd84616f71237986a66;hb=6e682412d5cc0dfaedb376482e585bf2989c6863;hpb=2f22c0c38f17e75be5541089076885442aaa2377 diff --git a/_source/plugins/find/dialogs/find.js b/_source/plugins/find/dialogs/find.js index a84315e..5f8c342 100644 --- a/_source/plugins/find/dialogs/find.js +++ b/_source/plugins/find/dialogs/find.js @@ -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 ) ) )