A simple example using django.utils.htmls.urlize:
{{{
>>> from django.utils.html import urlize
>>> urlize("o'ne...@example.com")
u'o\'<a href="mailto:ne...@example.com">ne...@example.com</a>'
}}}
I would expect this to return:
{{{
u'<a href="mailto:o\'ne...@example.com">o\'ne...@example.com</a>'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30589>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Mark Gregson):
Given the range of characters allowed in the local part of an email
address is quite extensive and that a quoted local part is also allowed
(RFC 3696 has a nice summary
https://tools.ietf.org/html/rfc3696#section-3), I realise that there
probably need to be some constraints on what range of email addresses
`urlize` can parse. Potentially then this issue should be resolved by
additional documentation clarifying those constraints.
--
Ticket URL: <https://code.djangoproject.com/ticket/30589#comment:1>
* cc: Shai Berger (added)
* component: Template system => Documentation
* version: 1.11 => master
* easy: 0 => 1
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. We excluded quotes in the #24471. It seems that
only single quotes from the list of allowed special characters are
affected. I agree that we can clarify this in the documentation, e.g.
{{{Email addresses cannot contain the single quotes (``'``).}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30589#comment:2>
* status: new => assigned
* owner: nobody => aitoehigie
Comment:
I will work on this.
--
Ticket URL: <https://code.djangoproject.com/ticket/30589#comment:3>
* has_patch: 0 => 1
Comment:
PR[https://github.com/django/django/pull/11526]
--
Ticket URL: <https://code.djangoproject.com/ticket/30589#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c2f381ef17058e5cfea58ae507983d2e459a2888" c2f381e]:
{{{
#!CommitTicketReference repository=""
revision="c2f381ef17058e5cfea58ae507983d2e459a2888"
Fixed #30589 -- Clarified that urlize should be applied only to email
addresses without single quotes.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30589#comment:5>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"b9d1bb6955d45d9da165ed11292a197d0728fe3f" b9d1bb69]:
{{{
#!CommitTicketReference repository=""
revision="b9d1bb6955d45d9da165ed11292a197d0728fe3f"
[2.2.x] Fixed #30589 -- Clarified that urlize should be applied only to
email addresses without single quotes.
Backport of c2f381ef17058e5cfea58ae507983d2e459a2888 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30589#comment:6>