From c43a24fb191f12964dbec184f58665c5442a6174 Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Mon, 8 Sep 2025 17:45:45 +0200 Subject: [PATCH] Improve string to identifier transformation (#512) Include all spaces characters (matching \s in a regex), not just the standard space character. --- src/common/endoflife.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/endoflife.py b/src/common/endoflife.py index 410f2f22..b1498d0f 100644 --- a/src/common/endoflife.py +++ b/src/common/endoflife.py @@ -135,6 +135,6 @@ def list_products(products_dir: Path, product_name: str = None) -> list[ProductF def to_identifier(s: str) -> str: """Convert a string to a valid endoflife.date identifier.""" identifier = s.strip().lower() - identifier = identifier.replace(" ", "-") + identifier = re.sub(r"\s+", "-", identifier) identifier = re.sub(r"-+", "-", identifier) return re.sub(r"[^a-z0-9.\-+_]", "", identifier)