#22941 closed Bug (fixed)
Add support for urls with no prefix (www/http(s)) and chars after the TLD to django.utils.html urlize.
Reported by: | LarryBrid | Owned by: | LarryBrid |
---|---|---|---|
Component: | Utilities | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently the urlize template tag will convert the following text into clickable links:
www.google.com/foo
http://google.com/foo
google.com
It will not convert the following into a clickable link:
google.com/foo
The current regex that handles this operation can be found here.
This patch proposes matching all chars after the TLD so that google.com/foo will be converted.
The urlize function handles the removal of cruft from the end of urls prior to running that regex, so the matching of all chars after the TLD shouldn't run the risk of including any unintended chars.
All tests are passing using sql lite, and it should be backward compatible as it doesn't really change anything except for what it is matching. It shouldn't require a documentation change, because it seems like this was the intended behavior according to the current documentation.
Change History (4)
comment:2 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This branch modifies the regex from its current for to ...net|org)(.*)$' in order to match chars after the closing TLD.