Skip to content

Commit 2d0b8af

Browse files
committed
Release version 0.0.0.dev69
1 parent 658bf0d commit 2d0b8af

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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"
2121
name = "PyLinks"
2222
dependencies = [
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
]
2727
requires-python = ">=3.10"
2828

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
requests >= 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

src/pylinks/string.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import 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

2325
def camel_to_title(string: str) -> str:

0 commit comments

Comments
 (0)