#5202: urlize filter before linebreaks doesn't work correctly
-----------------------------------+----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: new | Component: Template system
Version: 0.96 | Resolution:
Keywords: urlize linebreaks | Stage: Unreviewed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
-----------------------------------+----------------------------------------
Changes (by mtredinnick):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> given:
> p = "www.example.com"
>
> in template:
>
> {{ p|linebreaks|urlize }}
>
> Your link will not be urlize'd.
>
> However if given (note the line break):
> p = "My test www.example.com
> oh boy"
>
> using the same template, in my HTML I get:
>
> {{{
> <p>My test <a href="http://www.example.com%3Cbr"
> rel="nofollow">www.example.com<br></a> />oh boy</p>
> }}}
>
> It looks like the <br /> is getting broken.
>
> Workaround: switch the order of the filters!
>
> Possible Fixes: Make urlize treat the <br /> nicely. Or consider any
> angle bracket to be a word boundry (angle brackets aren't valid in URLs
> anyway, right?)
New description:
given:
{{{
p = "www.example.com"
}}}
in template:
{{{
{{ p|linebreaks|urlize }}
}}}
Your link will not be urlize'd.
However if given (note the line break):
{{{
p = "My test www.example.com
oh boy"
}}}
using the same template, in my HTML I get:
{{{
<p>My test <a href="http://www.example.com%3Cbr"
rel="nofollow">www.example.com<br></a> />oh boy</p>
}}}
It looks like the <br /> is getting broken.
Workaround: switch the order of the filters!
Possible Fixes: Make urlize treat the <br /> nicely. Or consider any
angle bracket to be a word boundry (angle brackets aren't valid in URLs
anyway, right?)
Comment:
(Tweaked description formatting)
--
Ticket URL: <http://code.djangoproject.com/ticket/5202#comment:1>
Django Code <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---