Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18644 closed Bug (fixed)

django.util.html.urlize fails to trim trailing period when followed by a parenthesis

Reported by: ljosa Owned by: ljosa
Component: Template system Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Users would probably expect

django.utils.html.urlize('(Go to http://www.example.com/foo.)')

to produce

u'(Go to <a href="http://www.ljosa.priv.no/foo">http://www.ljosa.priv.no/foo</a>.)'

and not

u'(Go to <a href="http://www.ljosa.priv.no/foo.">http://www.ljosa.priv.no/foo.</a>)'

as it does at present.

The fix should be easy; I expect to submit a pull request soon.

Change History (6)

comment:1 Changed 3 years ago by ljosa

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in Pull request 216. I also added a regression test.

comment:2 Changed 3 years ago by akaariai

  • Resolution fixed deleted
  • Status changed from closed to reopened

The ticket should not be closed until the patch gets committed into Django.

comment:3 Changed 3 years ago by akaariai

  • Triage Stage changed from Unreviewed to Ready for checkin

To me the patch looks good, and the use case valid. Marking as ready for checkin. I will wait a while for comments before committing this.

comment:4 Changed 3 years ago by ljosa

comment:5 Changed 3 years ago by Vebjorn Ljosa <vebjorn@…>

  • Resolution set to fixed
  • Status changed from reopened to closed

In [d5012d6371e804fc0427112cc1ceacbe8a059c4f]:

Fixed #18644 -- Made urlize trim trailing period followed by parenthesis

comment:6 Changed 3 years ago by Florian Apolloner <apollo13@…>

In [59d99772f0e3c69bc1824ce1e76438d89c50c9b9]:

Merge pull request #216 from ljosa/ticket_18644

Fixed #18644 -- Made urlize trim trailing period followed by parenthesis

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