Opened 9 years ago
Closed 9 years ago
#26193 closed Bug (fixed)
urlize doesn't handle extra punctuation after the link properly
Reported by: | Lee Semel | Owned by: | nobody |
---|---|---|---|
Component: | Utilities | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | jon.dufresne@… | 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
In the code below, the first call to urlize() works as expected, excluding the period from the url. I'd have expected the other examples to also exclude the punctuation from the link, but it always pulls in all of the punctuation save for the last character.
>>> from django.utils.html import urlize >>> urlize('This is a test http://testing.com/example.') u'This is a test <a href="http://testing.com/example">http://testing.com/example</a>.' >>> urlize('This is a test http://testing.com/example..') u'This is a test <a href="http://testing.com/example.">http://testing.com/example.</a>.' >>> urlize('This is a test http://testing.com/example!!') u'This is a test <a href="http://testing.com/example!">http://testing.com/example!</a>!' >>> urlize('This is a test http://testing.com/example!!!') u'This is a test <a href="http://testing.com/example!!">http://testing.com/example!!</a>!'
Change History (4)
comment:1 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 9 years ago
Cc: | added |
---|---|
Has patch: | set |
comment:3 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
https://github.com/django/django/pull/6129