It results in
text = "Check out www.djangoproject.com!"
text|urlize
>> "Check out <a href="(...)!">www.djangoproject.com!</a>"
--
Ticket URL: <https://code.djangoproject.com/ticket/23715>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> The template tag `urlize` cannot create the urls correctly when an
> exclamation mark follows an url.
>
> It results in
>
> text = "Check out www.djangoproject.com!"
> text|urlize
>
> >> "Check out <a href="(...)!">www.djangoproject.com!</a>"
New description:
The template tag `urlize` cannot create the urls correctly when an
exclamation mark follows an url.
text = "Check out www.djangoproject.com!"
text|urlize
results in:
"Check out <a href="(...)!">www.djangoproject.com!</a>"
--
--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:1>
Comment (by aaugustin):
Yes, but we should also consider the case where the ! is part of the URL.
Random, made-up example: www.unicode-lookup.info/q=!
--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:2>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:3>
Comment (by MarkusH):
What about `Go to google.com/?q=django!`? is the query `django` or
`django!`?
--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:4>
* cc: info+coding@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:5>
Comment (by aaugustin):
Mail.app has sophisticated URL detection rules, and here's how it handles
the examples we've given above:
* [http://www.unicode-lookup.info/q=]! — ! isn't part of the link.
* [google.com/?q=django!`?] — I can't get Trac to render this one
properly; !`? is part of the link.
--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:6>
* owner: nobody => MarkusH
* status: new => assigned
* has_patch: 0 => 1
Comment:
I added a pull-request: https://github.com/django/django/pull/3450
--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:7>
Comment (by aaugustin):
The patch looks good to me (assuming the CI passes).
--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:8>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"ed2f96819c9ad6e21e4d397b6418915f5caf522f"]:
{{{
#!CommitTicketReference repository=""
revision="ed2f96819c9ad6e21e4d397b6418915f5caf522f"
Fixed #23715 -- Prevented urlize from treating a trailing ! as part of an
URL
Thanks to 57even for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:10>