Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13504 closed (invalid)

urlize corrupts links in paras

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


Came across this after running urlize on some text that had been through markdown.

In [14]: from django.utils import html

In [15]: html.urlize("<p></p>")
Out[15]: u'<p></p>'   ## That was a surprise 

In [16]: html.urlize("<p></p>")
Out[16]: u'<p> <a href=""></p</a>>'  ## That can't be right


Change History (2)

comment:1 Changed 8 years ago by Karen Tracey

Resolution: invalid
Status: newclosed

The fact that urlize does not work properly on already-marked-up text is a documented restriction. From: "Note that if urlize is applied to text that already contains HTML markup, things won't work as expected. Apply this filter only to plain text."

comment:2 Changed 8 years ago by TomDunham

Many apologies, I should know to rtfm by now.

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