summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-11-24 15:28:53 +0100
committerAnton Khirnov <anton@khirnov.net>2021-11-24 15:28:53 +0100
commit652f88fa9c6db6c8185bedaf527364c719e5fe72 (patch)
tree25d16fba8c41bd49c1d112d789a90f304664e696
parentf1b767ece83a45b75710be6c1ab566cea401a6c8 (diff)
settings/manage: sanitize various Unicode zero-width spaces to nothing
-rw-r--r--alot/settings/manager.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/alot/settings/manager.py b/alot/settings/manager.py
index e4fa48d7..5d2098b0 100644
--- a/alot/settings/manager.py
+++ b/alot/settings/manager.py
@@ -637,6 +637,20 @@ class SettingsManager:
# expand tabs
table[ord('\t')] = ' ' * tab_width
+ # various Unicode zero-width spaces
+ # mongolian vowel separator
+ table[0x180e] = None
+ # zero width space
+ table[0x200b] = None
+ # zero width non-joiner
+ table[0x200c] = None
+ # zero width joiner
+ table[0x200d] = None
+ # word joiner
+ table[0x2060] = None
+ # BOM
+ table[0xfeff] = None
+
return table
@cached_property