mirror of https://github.com/django/django.git
Fixed #23558 -- documented slugify limitations
This commit is contained in:
parent
c0eea4645b
commit
03467368db
|
@ -228,9 +228,9 @@ def make_list(value):
|
||||||
@stringfilter
|
@stringfilter
|
||||||
def slugify(value):
|
def slugify(value):
|
||||||
"""
|
"""
|
||||||
Converts to lowercase, removes non-word characters (alphanumerics and
|
Converts to ASCII. Converts spaces to hyphens. Removes characters that
|
||||||
underscores) and converts spaces to hyphens. Also strips leading and
|
aren't alphanumerics, underscores, or hyphens. Converts to lowercase.
|
||||||
trailing whitespace.
|
Also strips leading and trailing whitespace.
|
||||||
"""
|
"""
|
||||||
return _slugify(value)
|
return _slugify(value)
|
||||||
|
|
||||||
|
|
|
@ -438,9 +438,9 @@ unescape_string_literal = allow_lazy(unescape_string_literal)
|
||||||
|
|
||||||
def slugify(value):
|
def slugify(value):
|
||||||
"""
|
"""
|
||||||
Converts to lowercase, removes non-word characters (alphanumerics and
|
Converts to ASCII. Converts spaces to hyphens. Removes characters that
|
||||||
underscores) and converts spaces to hyphens. Also strips leading and
|
aren't alphanumerics, underscores, or hyphens. Converts to lowercase.
|
||||||
trailing whitespace.
|
Also strips leading and trailing whitespace.
|
||||||
"""
|
"""
|
||||||
value = force_text(value)
|
value = force_text(value)
|
||||||
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
|
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
|
||||||
|
|
|
@ -2024,9 +2024,9 @@ If ``some_list`` is ``['a', 'b', 'c']``, the output will be ``['a', 'b']``.
|
||||||
slugify
|
slugify
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
|
|
||||||
Converts to lowercase, removes non-word characters (alphanumerics and
|
Converts to ASCII. Converts spaces to hyphens. Removes characters that aren't
|
||||||
underscores) and converts spaces to hyphens. Also strips leading and trailing
|
alphanumerics, underscores, or hyphens. Converts to lowercase. Also strips
|
||||||
whitespace.
|
leading and trailing whitespace.
|
||||||
|
|
||||||
For example::
|
For example::
|
||||||
|
|
||||||
|
|
|
@ -842,9 +842,9 @@ appropriate entities.
|
||||||
|
|
||||||
.. function:: slugify
|
.. function:: slugify
|
||||||
|
|
||||||
Converts to lowercase, removes non-word characters (alphanumerics and
|
Converts to ASCII. Converts spaces to hyphens. Removes characters that
|
||||||
underscores) and converts spaces to hyphens. Also strips leading and
|
aren't alphanumerics, underscores, or hyphens. Converts to lowercase. Also
|
||||||
trailing whitespace.
|
strips leading and trailing whitespace.
|
||||||
|
|
||||||
For example::
|
For example::
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue