From acae682442b0a2f9e6233c89ba293edd75a609c7 Mon Sep 17 00:00:00 2001 From: Ammar64 Date: Thu, 7 Nov 2024 13:06:26 +0200 Subject: [PATCH] =?UTF-8?q?count=20categories=20that=20starts=20with=20'##?= =?UTF-8?q?=20=E2=80=93'=20as=20well?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ensure_sorted.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ensure_sorted.py b/ensure_sorted.py index c9c7a8d..04951ee 100755 --- a/ensure_sorted.py +++ b/ensure_sorted.py @@ -72,6 +72,11 @@ def main(): if lines[i].startswith("### •"): category = Category(lines[i][6:-1]) categories.append(category) + # This is also a category + elif lines[i].startswith("## –"): + category_name = re.findall("(?<=##\s–\s).*?(?=\s–)", lines[i])[0] + category = Category(category_name) + categories.append(category) # This is an app elif lines[i].startswith("*"): # The last category in the categories list is the one we're working on