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 re
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
|
||||||
|
invalid_rendering = ["🕵️"]
|
||||||
|
|
||||||
def strip_modifiers(text):
|
def strip_modifiers(text):
|
||||||
def process_characters(text):
|
def process_characters(text):
|
||||||
result = []
|
result = []
|
||||||
|
|
@ -19,6 +21,9 @@ def strip_modifiers(text):
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
return ''.join(result)
|
return ''.join(result)
|
||||||
|
|
||||||
|
for char in invalid_rendering:
|
||||||
|
text = text.replace(char, " ")
|
||||||
|
|
||||||
stripped = process_characters(text)
|
stripped = process_characters(text)
|
||||||
stripped = re.sub(r'[\uFE00-\uFE0F]', '', stripped)
|
stripped = re.sub(r'[\uFE00-\uFE0F]', '', stripped)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue