File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ namespaces = true
1717# ----------------------------------------- Project Metadata -------------------------------------
1818#
1919[project ]
20- version = " 0.0.0.dev68 "
20+ version = " 0.0.0.dev69 "
2121name = " PyLinks"
2222dependencies = [
2323 " requests >= 2.31.0, < 3" ,
24- " ExceptionMan == 0.0.0.dev55 " ,
25- " MDit == 0.0.0.dev55 " ,
24+ " ExceptionMan == 0.0.0.dev56 " ,
25+ " MDit == 0.0.0.dev56 " ,
2626]
2727requires-python = " >=3.10"
2828
Original file line number Diff line number Diff line change 11requests >= 2.31.0 , < 3
2- ExceptionMan == 0.0.0.dev55
3- MDit == 0.0.0.dev55
2+ ExceptionMan == 0.0.0.dev56
3+ MDit == 0.0.0.dev56
Original file line number Diff line number Diff line change 22import unicodedata as _unicodedata
33
44
5- def to_slug (string : str ) -> str :
5+ def to_slug (string : str , reduce : bool = True ) -> str :
66 """Convert a string to a URL-friendly slug.
77
88 This function performs unicode-normalization on the string,
@@ -17,7 +17,9 @@ def to_slug(string: str) -> str:
1717 # Decode back to a string
1818 ascii_string = ascii_bytes .decode ('ascii' )
1919 lower_case_string = ascii_string .lower ()
20- return _re .sub (r'[^a-z0-9]+' , '-' , lower_case_string ).strip ('-' )
20+ if reduce :
21+ return _re .sub (r'[^a-z0-9]+' , '-' , lower_case_string ).strip ('-' )
22+ return _re .sub (r'[^a-z0-9]' , '-' , lower_case_string )
2123
2224
2325def camel_to_title (string : str ) -> str :
You can’t perform that action at this time.
0 commit comments