From d7923a96fc6eab7e6d0b0ceb263eb6e3f64925bc Mon Sep 17 00:00:00 2001 From: petesfrench Date: Tue, 21 Feb 2023 08:46:55 +0100 Subject: [PATCH] Remove regex compile from beautifulsoup search --- canonicalwebteam/discourse/parsers/docs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canonicalwebteam/discourse/parsers/docs.py b/canonicalwebteam/discourse/parsers/docs.py index 91c2b24..7004727 100644 --- a/canonicalwebteam/discourse/parsers/docs.py +++ b/canonicalwebteam/discourse/parsers/docs.py @@ -718,7 +718,7 @@ def _generate_headings_map(self, soup): current_list = headings_map previous_tag = None - headings = soup.findAll(re.compile("^h[2-3]$")) + headings = soup.find_all(["h2","h3"]) for heading in headings: current_tag = re.findall(r"\d", heading.name)[0]