[Django] #23715: Template tag urlize and exclamation mark

34 views
Skip to first unread message

Django

unread,
Oct 26, 2014, 3:48:52 AM10/26/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
---------------------------------+--------------------
Reporter: 57even | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------
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>"

--
Ticket URL: <https://code.djangoproject.com/ticket/23715>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 26, 2014, 3:49:24 AM10/26/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
---------------------------------+--------------------------------------

Reporter: 57even | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by 57even):

* 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>

Django

unread,
Oct 26, 2014, 4:30:42 AM10/26/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
---------------------------------+--------------------------------------

Reporter: 57even | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

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>

Django

unread,
Oct 27, 2014, 8:11:00 AM10/27/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
---------------------------------+------------------------------------

Reporter: 57even | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:3>

Django

unread,
Oct 31, 2014, 5:50:37 AM10/31/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
---------------------------------+------------------------------------

Reporter: 57even | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

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>

Django

unread,
Oct 31, 2014, 5:50:48 AM10/31/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
---------------------------------+------------------------------------

Reporter: 57even | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by MarkusH):

* cc: info+coding@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:5>

Django

unread,
Oct 31, 2014, 6:00:38 AM10/31/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
---------------------------------+------------------------------------

Reporter: 57even | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

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>

Django

unread,
Oct 31, 2014, 7:07:13 AM10/31/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
---------------------------------+------------------------------------
Reporter: 57even | Owner: MarkusH
Type: Bug | Status: assigned

Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by MarkusH):

* 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>

Django

unread,
Oct 31, 2014, 7:21:19 AM10/31/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
---------------------------------+------------------------------------
Reporter: 57even | Owner: MarkusH
Type: Bug | Status: assigned
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Comment (by aaugustin):

The patch looks good to me (assuming the CI passes).

--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:8>

Django

unread,
Oct 31, 2014, 7:21:25 AM10/31/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
-------------------------------------+-------------------------------------

Reporter: 57even | Owner: MarkusH
Type: Bug | Status: assigned
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/23715#comment:9>

Django

unread,
Oct 31, 2014, 8:08:32 AM10/31/14
to django-...@googlegroups.com
#23715: Template tag urlize and exclamation mark
-------------------------------------+-------------------------------------
Reporter: 57even | Owner: MarkusH
Type: Bug | Status: closed

Component: Template system | Version: 1.7
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* 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>

Reply all
Reply to author
Forward
0 new messages