fix: slugify now correctly lowercases English names and handles spaces

This commit is contained in:
xianren
2026-04-05 08:11:31 +08:00
parent 2a63a50ed3
commit e0afab5c9f
+2 -1
View File
@@ -55,7 +55,8 @@ def slugify(name: str) -> str:
pinyin_list = lazy_pinyin(name, style=Style.NORMAL)
slug = "-".join(pinyin_list)
else:
slug = name.lower().replace(" ", "-")
slug = name
slug = slug.lower().replace(" ", "-")
slug = "".join(c for c in slug if c.isalnum() or c == "-")
slug = slug.strip("-")
return slug