Code

Opened 5 years ago

Closed 5 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: UI/UX:

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!

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.