FIX: Ignora dobles espacios

This commit is contained in:
Roboron3042 2024-10-15 22:01:48 +02:00
parent f0bad020ae
commit 190a4e98af
1 changed files with 2 additions and 1 deletions

View File

@ -42,8 +42,9 @@ for i in range(0, max_notifications - 5):
n = notifications[i] n = notifications[i]
if str(n['id']) not in last_ids: if str(n['id']) not in last_ids:
# Mentions data are HTML paragraphs so we delete everything between <> to clean it up # Mentions data are HTML paragraphs so we delete everything between <> to clean it up
rawContent = n['status']['content'].replace("</br >", " ") rawContent = n['status']['content'].replace("</br >", " ").replace("<br>", " ")
text = BeautifulSoup(rawContent, "html.parser").get_text() text = BeautifulSoup(rawContent, "html.parser").get_text()
text = re.sub(" +", " ", text)
content = re.sub(no_unicode_spaces_pattern, "", text).split(" ") content = re.sub(no_unicode_spaces_pattern, "", text).split(" ")
try: try:
first_mention = content[0] first_mention = content[0]