commit 9549f8357d58288c923cf3aa51ca5ba08f601c04
parent 648ce867ad0605e5b068c0b03c48e20ca9c747a5
Author: Florian Dold <florian@dold.me>
Date: Thu, 27 Jan 2022 21:32:15 +0100
no special characters in slugs
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/talermerchantdemos/blog/content.py b/talermerchantdemos/blog/content.py
@@ -100,7 +100,7 @@ def add_from_html(resource_name, lang):
else:
title = title_el.get_text().strip()
slug = title.replace(" ", "_")
- # slug = quote(title.replace(" ", "_"), safe="")
+ slug = re.sub(r'[^a-zA-Z0-9_]*', "-", slug)
teaser = soup.find("p", attrs={"id": ["teaser"]})
if teaser is None: