Opened 16 years ago

Closed 16 years ago

#10873 closed (invalid)

urlize

Reported by: onno Owned by: nobody
Component: Template system Version: 1.1-beta
Severity: Keywords: urlize
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Adverted in the django docs is that a string http://www.example.com go's to <a href="http://www.example.com">www.example.com</a>
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#urlize

However this is not the case when you use teh model.URLField that requires http:// and ads a "/" to the end. Resulting in <a href="http://www.example.com">http://www.example.com/</a>

This is ugly and should be fixed!

Change History (1)

comment:1 by Luke Plant, 16 years ago

Resolution: invalid
Status: newclosed

urlize works exactly as advertised, and URLField does too.

Strictly speaking, www.example.com is not a URL, it is a domain, so it seems reasonable that URLField should either not accept it as a URL or convert it so that it is a URL. urlize is for marking up users' text in things like comments, whereas URLField is meant for storing URLs in the database, so it makes sense that it should be more fussy and only store actual URLs.

Note: See TracTickets for help on using tickets.
Back to Top