I am writing a simple tag as follows:

-------------
from django.template import Library
from django.utils.safestring import mark_for_escaping

register = Library()

@register.simple_tag
def testtag():
    return mark_for_escaping("&><%")
-------------

calling the tag from my template, inserts the string into my template
_unescaped_.

Having read http://docs.djangoproject.com/en/dev/howto/custom-template-tags/,
I am not sure how to use (auto)escaping from a simple tag.

Using mark_for_escaping doesn't work. simply returning the string and
wrapping the tag in the template with

{% autoescape on %}
{% testtag %}
{% endautoescape %}

doesn't work either.

what am I missing?
thanks for any insight
-frank

--~--~---------~--~----~------------~-------~--~----~
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