Opened 2 years ago

Closed 2 years ago

#23336 closed New feature (wontfix)

Allow urlize to accept extra attributes.

Reported by: Paul Owned by: Paul
Component: Template system Version: master
Severity: Normal Keywords: templatetag, urlize
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Paul)

If given a dictionary of extra attribute-values pairs, urlize should create <a> tags with the given attribute-value pairs.

Change History (4)

comment:1 Changed 2 years ago by Paul

Description: modified (diff)
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 2 years ago by Paul

Needs tests: set
Owner: changed from nobody to Paul
Status: newassigned

comment:3 Changed 2 years ago by Claude Paroz

Triage Stage: UnreviewedAccepted

You'll need to be careful about unsafe HTML content when building extra attributes.

comment:4 Changed 2 years ago by Tim Graham

Resolution: wontfix
Status: assignedclosed

The proposed patch only modifies django.utils.html.urlize() which isn't a documented public API and I'd consider it a private API for use by the urlize template tag. Not sure this is all that useful if the template tag can't make use of it. Overall, I think the use case is very narrow and not worth the extra complexity it will add.

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