minor fix
parent
23e4c76d24
commit
5c32c8215e
|
@ -637,11 +637,12 @@ def complies_with_chud(obj):
|
|||
old_body_html = obj.body_html
|
||||
|
||||
#torture body_html
|
||||
soup = BeautifulSoup(obj.body_html, 'lxml')
|
||||
tags = soup.html.body.find_all(lambda tag: tag.name not in {'blockquote','codeblock','pre'} and tag.string, recursive=False)
|
||||
for tag in tags:
|
||||
tag.string.replace_with(torture_ap(tag.string, obj.author.username))
|
||||
obj.body_html = str(soup).replace('<html><body>','').replace('</body></html>','')
|
||||
if obj.body_html:
|
||||
soup = BeautifulSoup(obj.body_html, 'lxml')
|
||||
tags = soup.html.body.find_all(lambda tag: tag.name not in {'blockquote','codeblock','pre'} and tag.string, recursive=False)
|
||||
for tag in tags:
|
||||
tag.string.replace_with(torture_ap(tag.string, obj.author.username))
|
||||
obj.body_html = str(soup).replace('<html><body>','').replace('</body></html>','')
|
||||
|
||||
#torture title_html and check for agendaposter_phrase in plain title and leave if it's there
|
||||
if isinstance(obj, Submission):
|
||||
|
|
Loading…
Reference in New Issue