Opened 7 years ago

Closed 4 years ago

#28694 closed Cleanup/optimization (fixed)

Make django.utils.text.slugify() strip dashes and underscores

Reported by: Elinaldo do Nascimento Monteiro Owned by: David Smith
Component: Utilities Version: dev
Severity: Normal Keywords: slugify, util
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Elinaldo do Nascimento Monteiro)

Bug generation slug

Example:

from django.utils import text
text.slugify("___This is a test ---")
output: ___this-is-a-test-

Improvement after correction

from django.utils import text
text.slugify("___This is a test ---")
output: this-is-a-test

PR

Change History (10)

comment:1 by Elinaldo do Nascimento Monteiro, 7 years ago

Description: modified (diff)

comment:2 by Elinaldo do Nascimento Monteiro, 7 years ago

Owner: changed from nobody to Elinaldo do Nascimento Monteiro
Status: newassigned

comment:3 by Elinaldo do Nascimento Monteiro, 7 years ago

Version: 1.11master

comment:4 by Elinaldo do Nascimento Monteiro, 7 years ago

Description: modified (diff)

comment:5 by Tim Graham, 7 years ago

Summary: django.utils.text.slugify Django slugify correctionMake django.utils.text.slugify() remove redundant dashes and underscores
Triage Stage: UnreviewedAccepted
Type: New featureCleanup/optimization

comment:6 by Tim Graham, 7 years ago

Patch needs improvement: set

The current version of the patch converts all underscores to dashes which (as discussed on the PR) isn't an obviously desired change. A discussion is needed to see if there's consensus about that change.

comment:7 by Mariusz Felisiak, 4 years ago

Owner: changed from Elinaldo do Nascimento Monteiro to David Smith
Patch needs improvement: unset

New PR.

comment:8 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set

comment:9 by Mariusz Felisiak, 4 years ago

Patch needs improvement: unset
Summary: Make django.utils.text.slugify() remove redundant dashes and underscoresMake django.utils.text.slugify() strip dashes and underscores
Triage Stage: AcceptedReady for checkin

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 0382ecfe:

Fixed #28694 -- Made django.utils.text.slugify() strip dashes and underscores.

Note: See TracTickets for help on using tickets.
Back to Top