Thank you for this great package! I have a question/feature request, though.
Suppose I have a call like this:
>>> slugify.slugify("1: Into the Dark")
'1-into-the-dark'
which is an invalid XML id attribute because it starts with a number (see also xml:id spec and NCName definition).
Would it make sense to add a valid_xml_id=True argument to the slugify() function? My current approach is somewhat naive:
slug = slugify.slugify(chapter_title, max_length=32)
if regex.fullmatch(r"^\d+.*", slug):
slug = f"chapter-{slug}"
but I think having support from slugify() might benefit others, too? Happy to attempt a PR, if it helps.
Thank you for this great package! I have a question/feature request, though.
Suppose I have a call like this:
which is an invalid XML
idattribute because it starts with a number (see alsoxml:idspec and NCName definition).Would it make sense to add a
valid_xml_id=Trueargument to theslugify()function? My current approach is somewhat naive:but I think having support from
slugify()might benefit others, too? Happy to attempt a PR, if it helps.