#26193: urlize doesn't handle extra punctuation after the link properly
----------------------------+--------------------
Reporter: lsemel | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------
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>!'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26193>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.4c0337ee4a144d2be381105024f5146a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.