Opened 17 years ago
Last modified 17 years ago
#5202 closed
urlize filter before linebreaks doesn't work correctly — at Version 1
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Template system | Version: | 0.96 |
Severity: | Keywords: | urlize linebreaks | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
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?)
Note:
See TracTickets
for help on using tickets.
(Tweaked description formatting)