Edit Book: Spell Check: Fix words surrounded by narrow non-breaking spaces being incorrectly detected as mis-spelled

This commit is contained in:
Kovid Goyal 2019-12-19 23:10:52 +05:30
parent 511d3c6ba4
commit 1bc5389576
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -94,7 +94,7 @@ def add_words(text, node, words, file_name, locale, node_item):
p = patterns() p = patterns()
is_fr = locale.langcode == 'fra' is_fr = locale.langcode == 'fra'
for word in candidates: for word in candidates:
sword = p.sanitize_invisible_pat.sub('', word) sword = p.sanitize_invisible_pat.sub('', word).strip()
elided_prefix = '' elided_prefix = ''
if is_fr: if is_fr:
m = p.fr_elision_pat.match(sword) m = p.fr_elision_pat.match(sword)