9 lines
258 B
Python
9 lines
258 B
Python
import re
|
|
import unicodedata
|
|
|
|
|
|
def slugify(title: str) -> str:
|
|
normalized = unicodedata.normalize("NFKD", title)
|
|
ascii_title = normalized.encode("ascii", "ignore").decode("ascii")
|
|
return re.sub(r"[^a-z0-9]+", "-", ascii_title.lower()).strip("-")
|