mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-12-30 13:14:40 +01:00
Strip invalid rendering emojis
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import re
|
||||
import unicodedata
|
||||
|
||||
invalid_rendering = ["🕵️"]
|
||||
|
||||
def strip_modifiers(text):
|
||||
def process_characters(text):
|
||||
result = []
|
||||
@@ -19,6 +21,9 @@ def strip_modifiers(text):
|
||||
i += 1
|
||||
|
||||
return ''.join(result)
|
||||
|
||||
for char in invalid_rendering:
|
||||
text = text.replace(char, " ")
|
||||
|
||||
stripped = process_characters(text)
|
||||
stripped = re.sub(r'[\uFE00-\uFE0F]', '', stripped)
|
||||
|
||||
Reference in New Issue
Block a user