Opened 9 months ago

Closed 9 months ago

#23336 closed New feature (wontfix)

Allow urlize to accept extra attributes.

Reported by: logston Owned by: logston
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 logston)

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

https://github.com/logston/django/tree/ticket_23336

Change History (4)

comment:1 Changed 9 months ago by logston

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

comment:2 Changed 9 months ago by logston

  • Needs tests set
  • Owner changed from nobody to logston
  • Status changed from new to assigned

comment:3 Changed 9 months ago by claudep

  • Triage Stage changed from Unreviewed to Accepted

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

comment:4 Changed 9 months ago by timgraham

  • Resolution set to wontfix
  • Status changed from assigned to closed

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