JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.4
[ckeditor.git] / _source / plugins / find / dialogs / find.js
index a84315e..5f8c342 100644 (file)
@@ -155,7 +155,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                if ( this._.matchWord && !currentTextNode\r
                                                         || this._.walker._.end )\r
                                                        break;\r
-                                       }\r
+                                               }\r
                                        // Found a fresh text node.\r
                                        this.textNode = currentTextNode;\r
                                        if ( currentTextNode )\r
@@ -495,8 +495,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                tail = cursors[ cursors.length - 1 ],\r
                                                                head = cursors[ 0 ];\r
 \r
-                                                       var headWalker = new characterWalker( getRangeBeforeCursor( head ), true ),\r
-                                                               tailWalker = new characterWalker( getRangeAfterCursor( tail ), true );\r
+                                                       var rangeBefore = getRangeBeforeCursor( head ),\r
+                                                               rangeAfter = getRangeAfterCursor( tail );\r
+\r
+                                                       // The word boundary checks requires to trim the text nodes. (#9036)\r
+                                                       rangeBefore.trim();\r
+                                                       rangeAfter.trim();\r
+\r
+                                                       var headWalker = new characterWalker( rangeBefore, true ),\r
+                                                               tailWalker = new characterWalker( rangeAfter, true );\r
 \r
                                                        if ( ! ( isWordSeparator( headWalker.back().character )\r
                                                                                && isWordSeparator( tailWalker.next().character ) ) )\r