diff --git a/CHANGELOG.md b/CHANGELOG.md index d64cb0e..9aa0ef2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.0.4 + +- Properly handle uppercase special characters (@mib1185 - thx) + ## 8.0.3 - Drop compatibility for unsupported Python Version (@Viicos - thx) diff --git a/slugify/__version__.py b/slugify/__version__.py index 12c76b6..854038e 100644 --- a/slugify/__version__.py +++ b/slugify/__version__.py @@ -5,4 +5,4 @@ __url__ = 'https://github.com/un33k/python-slugify' __license__ = 'MIT' __copyright__ = 'Copyright 2022 Val Neekman @ Neekware Inc.' -__version__ = '8.0.3' +__version__ = '8.0.4' diff --git a/slugify/special.py b/slugify/special.py index 0b602cf..918cb2a 100644 --- a/slugify/special.py +++ b/slugify/special.py @@ -9,7 +9,6 @@ def add_uppercase_char(char_list: list[tuple[str, str]]) -> list[tuple[str, str] upper_dict = char.upper(), xlate.capitalize() if upper_dict not in char_list and char != upper_dict[0]: char_list.insert(0, upper_dict) - return char_list return char_list diff --git a/test.py b/test.py index 2534499..d13ef94 100644 --- a/test.py +++ b/test.py @@ -4,6 +4,7 @@ import unittest from contextlib import contextmanager +from slugify import PRE_TRANSLATIONS from slugify import slugify from slugify import smart_truncate from slugify.__main__ import slugify_params, parse_args @@ -236,9 +237,11 @@ def test_replacements_german_umlaut_custom(self): r = slugify(txt, replacements=[['Ü', 'UE'], ['ü', 'ue']]) self.assertEqual(r, "ueber-ueber-german-umlaut") + def test_pre_translation(self): + 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')]) -class TestSlugifyUnicode(unittest.TestCase): +class TestSlugifyUnicode(unittest.TestCase): def test_extraneous_seperators(self): txt = "This is a test ---"