Opened 7 years ago

Closed 7 years ago

#26958 closed Bug (invalid)

Django urlize inside html tags

Reported by: Henrique Chehad Owned by: nobody
Component: Template system Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no



The urlize is processing urls inside params.

It is adding "<a href=" inside attributes.


>>> from django.utils.html import urlize
>>> text = "<img src=\"\">"
>>> urlize(text)

u'<img src="<a href=""></a>">'
>>> text = '<iframe src="">'
>>> urlize(text)
u'<iframe src="<a href=""></a>">'

It didn't appeared in previous version (tested in 1.6)

Change History (1)

comment:1 Changed 7 years ago by Tim Graham

Component: Core (Other)Template system
Resolution: invalid
Status: newclosed
Type: UncategorizedBug

The documentation says, "If urlize is applied to text that already contains HTML markup, things won’t work as expected. Apply this filter only to plain text."

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