Re: Print html the normal way
On Fri, Oct 5, 2012 at 9:20 AM, Ashish Jain <ashishjain.ash@gmail.com> wrote:
> Hi,
>
> I wrote a simple filter as:
>
> @register.filter()
> def html(value):
> return '<p>Check</p>'
>
> when I use this filter in my template, it displays html as:
>
> <p>Check</p>
>
> I want to display as:
>
> Check
>
> am I missing something.
>
You haven't marked the output as safe, so Django escapes it:
https://docs.djangoproject.com/en/1.4/howto/custom-template-tags/#filters-and-auto-escaping
You want option 2.
Cheers
Tom
--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home