Fix HTML flattening bug
authorJakob Cornell <jakob+gpg@jcornell.net>
Thu, 29 Sep 2022 03:27:00 +0000 (22:27 -0500)
committerJakob Cornell <jakob+gpg@jcornell.net>
Sun, 2 Oct 2022 21:14:15 +0000 (16:14 -0500)
strikebot/src/strikebot/updates.py

index 31d9cd03960a1497828221781beefdfdf00c6f1d..5eb3c00b356aa340103640aca22e9ddd36c41aad 100644 (file)
@@ -35,7 +35,7 @@ def parse_update(payload_data: dict, curr_count: Optional[int], bot_user: str) -
 
        # flatten the update content to plain text
        tree = BeautifulSoup(payload_data["body_html"], "html.parser")
-       worklist = tree.contents
+       worklist = list(reversed(tree.contents))
        out = [[]]
        while worklist:
                el = worklist.pop()