Index: components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java |
diff --git a/components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java b/components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java |
index b2ce3297cc22dd808207b23875910336a55a7a82..25728da96eeca57a9b9289c4577d17b1ebd2acc8 100644 |
--- a/components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java |
+++ b/components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java |
@@ -125,7 +125,12 @@ public class SpellCheckerSessionBridge implements SpellCheckerSessionListener { |
SuggestionsInfo info = result.getSuggestionsInfoAt(i); |
ArrayList<String> suggestions_for_word = new ArrayList<String>(); |
for (int j = 0; j < info.getSuggestionsCount(); ++j) { |
- suggestions_for_word.add(info.getSuggestionAt(j)); |
+ String suggestion = info.getSuggestionAt(j); |
+ // Remove zero-length space from end of suggestion, if any |
+ if (suggestion.charAt(suggestion.length() - 1) == 0x200b) { |
timvolodine
2017/06/16 15:25:37
Can the suggestion be zero-length? (i.e. such that
|
+ suggestion = suggestion.substring(0, suggestion.length() - 1); |
+ } |
+ suggestions_for_word.add(suggestion); |
} |
suggestions.add( |
suggestions_for_word.toArray(new String[suggestions_for_word.size()])); |