tinymce/tinymce — pull request #182 by cyharyanto (2013-04-03 04:26:08+00:00)
Title: Bug fixing in spellchecker and searchreplace plugin.

During our test and development of TinyMCE for integration to our application, we have found, reproduce, and fix two bugs in TinyMCE's plugins. The first bug is the spellchecker unable to detect misspelt word followed by an unencoded 0x40 (non-breaking space) under IE 8. Other browsers correctly encode 0x40 as and therefore this bug doesn't appear. The second bug is in the search/replace plugin. When we click the replace button for the first time, it will simply replace the currently selected text in the editor instead of finding the correct match first and do the replace. The details to reproduce of those bugs are included below and in the commit log.

1. Fix bug of 0xA0 in IE8 breaks the spellchecker.
>
> Example type following:
> sourcebuzz sourcebuzz
>
> (note the two space between two words).
> In IE8, the first misspelling won't be identified because of an unencoded 0xA0 character is added after the first word (it becomes "sourcebuzz[0xA0][0x20]sourcebuzz"). Other browsers correctly encode 0xA0 as therefore the spellchecker detect the word correctly. Solution: add the 0xA0 character into the _getSeparators() function.

2. Fixed bug where search/replace replace the selection even if it's not pointed to the search result.
>
> Example type following:
> a b c d e f g h i j
>
> Now select 'a' and open the replace dialog box. Type 'e' in 'Find What' textbox and 'E' in 'Replace with' textbox and press 'Replace'.
>
> Failure result:
> 'a' in the editor will be replaced by 'E'.
>
> Expected result:
> 'a' will not be replaced and 'e' in the text editor is now selected to be replaced by 'E'.
>
> Solution:
Add a condition to not replace when the selection isn't pointed to the correct match of 'Find What'.