diff --git a/earwigbot/wiki/copyvios/parsers.py b/earwigbot/wiki/copyvios/parsers.py index c5e4325..ec7fe68 100644 --- a/earwigbot/wiki/copyvios/parsers.py +++ b/earwigbot/wiki/copyvios/parsers.py @@ -137,8 +137,10 @@ class HTMLTextParser(BaseTextParser): soup = bs4.BeautifulSoup(self.text).body is_comment = lambda text: isinstance(text, bs4.element.Comment) - [comment.extract() for comment in soup.find_all(text=is_comment)] + for comment in soup.find_all(text=is_comment): + comment.extract() for tag in self.hidden_tags: - [element.extract() for element in soup.find_all(tag)] + for element in soup.find_all(tag): + element.extract() return "\n".join(soup.stripped_strings)