From 8f0be4200f9e93ccd35d60cc0a5436ab5f168c8b Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 1 Oct 2023 13:14:15 +0200 Subject: remove ugly 'Lernbereich' and ':' strings from section number --- scripts/gen_map/gen_map.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/gen_map/gen_map.py b/scripts/gen_map/gen_map.py index 90b848af..8765336b 100755 --- a/scripts/gen_map/gen_map.py +++ b/scripts/gen_map/gen_map.py @@ -153,6 +153,10 @@ def parse_section_html(section, summary_class: str) -> t.Tuple[str, str, int]: 'class': 'head-absatz-num' }).children)[2].strip() + if num.startswith('Lernbereich'): + # strip "Lernbreich" and trailing ':' + num = num[len('Lernbereich'):-1] + summary = section.find(**{'class': summary_class}).string.strip() summary = summary.replace('\xa0', ' ') -- cgit v1.2.3