Skip to content

Commit 2433548

Browse files
un33kViicosmib1185
authored
Uppercase handling of special chars (#149)
* Remove compatibility with unsupported Python versions (#146) * fix uppercase pre-translations (#148) Co-authored-by: Viicos <65306057+Viicos@users.noreply.github.com> Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
1 parent 26b81c2 commit 2433548

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 8.0.4
2+
3+
- Properly handle uppercase special characters (@mib1185 - thx)
4+
15
## 8.0.3
26

37
- Drop compatibility for unsupported Python Version (@Viicos - thx)

slugify/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
__url__ = 'https://github.com/un33k/python-slugify'
66
__license__ = 'MIT'
77
__copyright__ = 'Copyright 2022 Val Neekman @ Neekware Inc.'
8-
__version__ = '8.0.3'
8+
__version__ = '8.0.4'

slugify/special.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ def add_uppercase_char(char_list: list[tuple[str, str]]) -> list[tuple[str, str]
99
upper_dict = char.upper(), xlate.capitalize()
1010
if upper_dict not in char_list and char != upper_dict[0]:
1111
char_list.insert(0, upper_dict)
12-
return char_list
1312
return char_list
1413

1514

test.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import unittest
55
from contextlib import contextmanager
66

7+
from slugify import PRE_TRANSLATIONS
78
from slugify import slugify
89
from slugify import smart_truncate
910
from slugify.__main__ import slugify_params, parse_args
@@ -236,9 +237,11 @@ def test_replacements_german_umlaut_custom(self):
236237
r = slugify(txt, replacements=[['Ü', 'UE'], ['ü', 'ue']])
237238
self.assertEqual(r, "ueber-ueber-german-umlaut")
238239

240+
def test_pre_translation(self):
241+
self.assertEqual(PRE_TRANSLATIONS, [('Ю', 'U'), ('Щ', 'Sch'), ('У', 'Y'), ('Х', 'H'), ('Я', 'Ya'), ('Ё', 'E'), ('ё', 'e'), ('я', 'ya'), ('х', 'h'), ('у', 'y'), ('щ', 'sch'), ('ю', 'u'), ('Ü', 'Ue'), ('Ö', 'Oe'), ('Ä', 'Ae'), ('ä', 'ae'), ('ö', 'oe'), ('ü', 'ue'), ('Ϋ́', 'Y'), ('Ϋ', 'Y'), ('Ύ', 'Y'), ('Υ', 'Y'), ('Χ', 'Ch'), ('χ', 'ch'), ('Ξ', 'X'), ('ϒ', 'Y'), ('υ', 'y'), ('ύ', 'y'), ('ϋ', 'y'), ('ΰ', 'y')])
239242

240-
class TestSlugifyUnicode(unittest.TestCase):
241243

244+
class TestSlugifyUnicode(unittest.TestCase):
242245
def test_extraneous_seperators(self):
243246

244247
txt = "This is a test ---"

0 commit comments

Comments
 (0)