Commit 6c1fa374 authored by twanvl's avatar twanvl

fixed: reminder text of a keyword can not be disabled if that keyword appears...

fixed: reminder text of a keyword can not be disabled if that keyword appears as the start of another word before it.
parent b5c343d5
...@@ -483,7 +483,24 @@ String KeywordDatabase::expand(const String& text, ...@@ -483,7 +483,24 @@ String KeywordDatabase::expand(const String& text,
size_t start = untagged_to_index(s, start_u, true), size_t start = untagged_to_index(s, start_u, true),
end = untagged_to_index(s, start_u + len_u, true); end = untagged_to_index(s, start_u + len_u, true);
if (start == end) continue; // don't match empty keywords if (start == end) continue; // don't match empty keywords
result += s.substr(0, start); // copy text before keyword
result += remove_tag(s.substr(0, start), _("<kw-"));
// a part of s has not been searched for <kw- tags
// this can happen when the trie incorrectly matches too early
for (size_t j = i+1 ; j < start ;) {
Char c = s.GetChar(j);
if (c == _('<')) {
if (is_substr(s, j, _("<kw-")) && j + 4 < s.size()) {
expand_type = s.GetChar(j + 4); // <kw-?>
} else if (is_substr(s, j, _("</kw-"))) {
expand_type = 'a';
}
j = skip_tag(s, j);
} else {
++j;
}
}
// Split the keyword, set parameters in context // Split the keyword, set parameters in context
String total; // the total keyword String total; // the total keyword
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment