Hello all,
I need to use macros, but I don'1 want the output to be escaped. How
can I achieve that ? E.g.
{% macro whitebox(contents, id='') -%}
<div class="whitebox" {%if id != '' %}id="id"{% endif%}>
{{ contents }}
</div>
{%- endmacro %}
{{ whitebox('<form action="/register" method="POST">
<h2>Register</h2>
<p>After registering, you'll be able to access the full contents
of the site.</p>
<input type="button" name="submit" value="Register" />
</form>'), 'registerbox'
}}
As it currently is, the contents of the macro call goes escaped (i.e.
lots of '\n' and the like).
I tried to use the "|safe" filter or render the macro with the minus
sign (i.e. {{- whitebox ..}}), it didn't work either: the contents is
escaped before rendering.
Is the only to do it way to subclass the macro call ?
Best regards,
Howe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en
-~----------~----~----~----~------~----~------~--~---