diff --git a/AUTHORS.rst b/AUTHORS.rst index f01ef5a..2037d82 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -89,3 +89,4 @@ Contributors - Arin Aeruva, `arin30@github `_ - Cyber Marty, `Cyber-Marty@github `_ - Rajatendu Dey, `Rajatendu1@github `_ +- Jay Hemnani, `jayhemnani9910@github `_ diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5951549..ce20047 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,8 @@ Changelog Unreleased ---------- +- Transliterate letters like ``ß``, ``æ``, ``ø`` and ``Ł`` in ``slugify`` through ``deburr`` instead of + dropping them. - Search values in generic mappings with ``includes`` and respect the start offset. - Support ``range`` objects in ``index_of``, including when a start index is supplied. - Merge nested mutable mappings in place instead of replacing their existing contents, including diff --git a/src/pydash/strings.py b/src/pydash/strings.py index 30ee60c..977fa68 100644 --- a/src/pydash/strings.py +++ b/src/pydash/strings.py @@ -1728,7 +1728,7 @@ def slugify(text: t.Any, separator: str = "-") -> str: Remove single quotes from output. """ normalized = ( - unicodedata.normalize("NFKD", pyd.to_string(text)) + unicodedata.normalize("NFKD", deburr(pyd.to_string(text))) .encode("ascii", "ignore") .decode("utf8") .replace("'", "") diff --git a/tests/test_strings.py b/tests/test_strings.py index 8708b45..8aff9a4 100644 --- a/tests/test_strings.py +++ b/tests/test_strings.py @@ -898,6 +898,7 @@ def test_series_phrase_serial(case, expected): (" foo bar ", "foo-bar"), ("Un éléphant à l'orée du bois", "un-elephant-a-loree-du-bois"), ("shouldn't couldn't wouldn't", "shouldnt-couldnt-wouldnt"), + ("Ærøskøbing Straße", "aeroskobing-strasse"), ("", ""), (5, "5"), (None, ""),