summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hoffman <dhoffman34@icloud.com>2014-10-13 18:15:36 -0400
committerTim Graham <timograham@gmail.com>2014-10-30 09:02:04 -0400
commit03467368dbd6a427985f86463faa61619f08c833 (patch)
tree2c4325d346ae9a25b486f7fbc0673285772c6db0
parentc0eea4645b7859a505ac65652f5ebb55a75e59b7 (diff)
Fixed #23558 -- documented slugify limitations
-rw-r--r--django/template/defaultfilters.py6
-rw-r--r--django/utils/text.py6
-rw-r--r--docs/ref/templates/builtins.txt6
-rw-r--r--docs/ref/utils.txt6
4 files changed, 12 insertions, 12 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index 3e35e67bd0..16a3d4d6e9 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -228,9 +228,9 @@ def make_list(value):
@stringfilter
def slugify(value):
"""
- Converts to lowercase, removes non-word characters (alphanumerics and
- underscores) and converts spaces to hyphens. Also strips leading and
- trailing whitespace.
+ Converts to ASCII. Converts spaces to hyphens. Removes characters that
+ aren't alphanumerics, underscores, or hyphens. Converts to lowercase.
+ Also strips leading and trailing whitespace.
"""
return _slugify(value)
diff --git a/django/utils/text.py b/django/utils/text.py
index b2645e8697..37bcd3150e 100644
--- a/django/utils/text.py
+++ b/django/utils/text.py
@@ -438,9 +438,9 @@ unescape_string_literal = allow_lazy(unescape_string_literal)
def slugify(value):
"""
- Converts to lowercase, removes non-word characters (alphanumerics and
- underscores) and converts spaces to hyphens. Also strips leading and
- trailing whitespace.
+ Converts to ASCII. Converts spaces to hyphens. Removes characters that
+ aren't alphanumerics, underscores, or hyphens. Converts to lowercase.
+ Also strips leading and trailing whitespace.
"""
value = force_text(value)
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index 8e74d1e44a..e9c2e0c391 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -2024,9 +2024,9 @@ If ``some_list`` is ``['a', 'b', 'c']``, the output will be ``['a', 'b']``.
slugify
^^^^^^^
-Converts to lowercase, removes non-word characters (alphanumerics and
-underscores) and converts spaces to hyphens. Also strips leading and trailing
-whitespace.
+Converts to ASCII. Converts spaces to hyphens. Removes characters that aren't
+alphanumerics, underscores, or hyphens. Converts to lowercase. Also strips
+leading and trailing whitespace.
For example::
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt
index 507f3d6095..4c7368f687 100644
--- a/docs/ref/utils.txt
+++ b/docs/ref/utils.txt
@@ -842,9 +842,9 @@ appropriate entities.
.. function:: slugify
- Converts to lowercase, removes non-word characters (alphanumerics and
- underscores) and converts spaces to hyphens. Also strips leading and
- trailing whitespace.
+ Converts to ASCII. Converts spaces to hyphens. Removes characters that
+ aren't alphanumerics, underscores, or hyphens. Converts to lowercase. Also
+ strips leading and trailing whitespace.
For example::