minor fix

pull/142/head
Aevann 2023-03-26 14:28:32 +02:00
parent 5c32c8215e
commit ed7baccb5c
1 changed files with 8 additions and 7 deletions

View File

@ -651,12 +651,13 @@ def complies_with_chud(obj):
return True return True
#check for agendaposter_phrase in body_html #check for agendaposter_phrase in body_html
excluded_tags = {'del','sub','sup','marquee','spoiler','lite-youtube','video','audio'} if old_body_html:
soup = BeautifulSoup(old_body_html, 'lxml') excluded_tags = {'del','sub','sup','marquee','spoiler','lite-youtube','video','audio'}
tags = soup.html.body.find_all(lambda tag: tag.name not in excluded_tags and not tag.attrs, recursive=False) soup = BeautifulSoup(old_body_html, 'lxml')
for tag in tags: tags = soup.html.body.find_all(lambda tag: tag.name not in excluded_tags and not tag.attrs, recursive=False)
for text in tag.find_all(text=True, recursive=False): for tag in tags:
if obj.author.agendaposter_phrase in text.lower(): for text in tag.find_all(text=True, recursive=False):
return True if obj.author.agendaposter_phrase in text.lower():
return True
return False return False