hi,

i think there is some use of unnecessary mark_safe in the above-mentioned
function, but maybe i am overlooking something, so i thought before opening
a ticket i will discuss it here.

if you check the urlize-function
https://github.com/django/django/blob/master/django/utils/html.py#L173,

it basically splits the text into parts, changes some of the parts, and
then joins them back together.

when processing the parts, if the original content was marked-safe, it will
mark_safe the parts too (more or less, i am skipping some details).
but at the end, it uses ''.join to join them.

but, joining marked-safe strings does not preserve the marked-safe status.
in other words:

type(''.join([mark_safe('<div>')])) == str

so why do we spend time on marking the parts as safe, when we simply lose
this info at the end?

thanks,
gabor

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to