From: Jakob Cornell Date: Thu, 29 Sep 2022 03:27:00 +0000 (-0500) Subject: Fix HTML flattening bug X-Git-Tag: strikebot-0.0.7~13 X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=5e31b51843f3c579fdc4080bd040132bd72ba27e;p=counting.git Fix HTML flattening bug --- diff --git a/strikebot/src/strikebot/updates.py b/strikebot/src/strikebot/updates.py index 31d9cd0..5eb3c00 100644 --- a/strikebot/src/strikebot/updates.py +++ b/strikebot/src/strikebot/updates.py @@ -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()