Simon Willison wrote:
> On Jan 8, 6:47 am, Michael Hipp <[EMAIL PROTECTED]> wrote:
>> Learning about context processors, I have one like this:
>>
>> def bold_word(request):
>>      html = "A <b>bold</b> word."
>>      return {'bold_word': html,}
>>
>> I expected a *bold* word to show up in the browser, but instead here's
>> what is sent:
>>
>>    A &lt;b&gt;bold&lt;/b&gt; word.
>>
>> So the angle brackets show up (literally) in the browser.
>>
>> How do I say "no thanks" to this helpfulness so my html can to thru?
> 
> You can mark the string as "safe" in your context processor:
> 
> from django.utils.safestring import mark_safe
> 
> def bold_word(request):
>      html = mark_safe("A <b>bold</b> word.")
>      return {'bold_word': html,}

Thanks!

Michael

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

Reply via email to