PolicyStat / ckeditor-spell-check-plugin-js-dev-edge

User interface enhancements and beta features for http://ckeditor-spellcheck.nanospell.com . This repo is for nanospell developers and trusted partners to modify and fork plugin.js
Other
0 stars 0 forks source link

Fix problem with incorrect spellcheck spans #25

Closed sbaughman closed 8 years ago

sbaughman commented 8 years ago

Adding the if checks in the returns of WordWalker.getNextWord caused an issue where if the word was an empty string, the loop would continue and this could cause a returned range to include multiple words. This caused spellcheck spans to get wrapped around multiple words incorrectly, as well as potentially causing nested spellcheck spans.

Instead, the responsibility of ignoring empty strings is moved to the functions where WordWalker.getNextWord is called. This was already the case in markTyposInRange, and is now added to getWords, as well as the getWordsWithWordWalker function in the wordwalker.js test.