diff --git a/canonicalwebteam/discourse/parsers/tutorials.py b/canonicalwebteam/discourse/parsers/tutorials.py index 1b382e1..dcd46e1 100644 --- a/canonicalwebteam/discourse/parsers/tutorials.py +++ b/canonicalwebteam/discourse/parsers/tutorials.py @@ -54,7 +54,8 @@ def _get_sections(self, soup): for heading in headings: section = {} - section_soup = self._get_section(soup, heading.text) + heading_text = heading.text.strip() + section_soup = self._get_section(soup, heading_text) first_child = section_soup.find() if section_soup else None if first_child and first_child.text.startswith("Duration"): @@ -72,11 +73,11 @@ def _get_sections(self, soup): first_child.extract() - section["title"] = heading.text + section["title"] = heading_text section["content"] = str(section_soup) heading_pieces = filter( - lambda s: s.isalnum() or s.isspace(), heading.text.lower() + lambda s: s.isalnum() or s.isspace(), heading_text.lower() ) section["slug"] = "".join(heading_pieces).replace(" ", "-") diff --git a/setup.py b/setup.py index f7eeff4..8021264 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name="canonicalwebteam.discourse", - version="5.4.4", + version="5.4.5", author="Canonical webteam", author_email="webteam@canonical.com", url="https://github.com/canonical/canonicalwebteam.discourse",