From 0382ecfe020b4c51b4c01e4e9a21892771e66941 Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 26 May 2020 22:56:41 +0100 Subject: Fixed #28694 -- Made django.utils.text.slugify() strip dashes and underscores. --- docs/ref/utils.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs/ref') diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index dcc354e2e2..921aba5de8 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -853,8 +853,8 @@ appropriate entities. #. Converting to lowercase. #. Removing characters that aren't alphanumerics, underscores, hyphens, or whitespace. - #. Removing leading and trailing whitespace. #. Replacing any whitespace or repeated dashes with single dashes. + #. Removing leading and trailing whitespace, dashes, and underscores. For example:: @@ -867,6 +867,11 @@ appropriate entities. >>> slugify('你好 World', allow_unicode=True) '你好-world' + .. versionchanged:: 3.2 + + In older versions, leading and trailing dashes and underscores are not + removed. + .. _time-zone-selection-functions: ``django.utils.timezone`` -- cgit v1.3