voronind/awesome-slugify

UniqueSlugify will exceed max_length if it adds digits to make slug unique

iandees opened this issue · 0 comments

Python 3.6.4 (default, Mar  9 2018, 23:15:03)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from slugify import UniqueSlugify
>>> s = UniqueSlugify(to_lower=True, max_length=3)
>>> s("Hello World")
'hel'
>>> s("Hello World")
'hel-1'

I would expect something like hel, h-1, etc.