mirror of
https://github.com/markqvist/NomadNet.git
synced 2026-01-09 20:41:07 -05:00
Strip invalid rendering emojis
This commit is contained in:
parent
c4bf97dae2
commit
d3ddfd6c9c
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue