From f0c0b51e6cb87ef9202ee42d21fd5f08c7f15718 Mon Sep 17 00:00:00 2001 From: Twan van Laarhoven Date: Tue, 26 May 2020 22:30:45 +0200 Subject: [PATCH] Fix #59, fix #61: * Now a // anywhere within a word disables the spellchecker. * Consider single quotes to be a part of a word, for things like "doesn't". TODO: this will do the wrong thing for text in single quotes --- src/script/functions/spelling.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/script/functions/spelling.cpp b/src/script/functions/spelling.cpp index 22e944fb..50afa5b1 100644 --- a/src/script/functions/spelling.cpp +++ b/src/script/functions/spelling.cpp @@ -50,6 +50,10 @@ void check_word(const String& tag, const String& input, size_t start, size_t end if (!good) { out += _(" 0) check_this_word = false; ++pos; } else { // a non-word character, punctuation or space // check word, add to result - check_word(tag, input, word_start, pos, result, unchecked_tag <= 0, checkers, extra_match, ctx); + check_word(tag, input, word_start, pos, result, check_this_word, checkers, extra_match, ctx); word_start = String::npos; + check_this_word = unchecked_tag <= 0; result += c; ++pos; } } // last word - check_word(tag, input, word_start, input.size(), result, unchecked_tag <= 0, checkers, extra_match, ctx); + check_word(tag, input, word_start, input.size(), result, check_this_word, checkers, extra_match, ctx); // done assert_tagged(result); SCRIPT_RETURN(result);