wrouesnel / p2cli

pongo2 cli - like the j2cli package in python, but compiles to self-contained go executables
GNU General Public License v2.0
87 stars 19 forks source link

Disable autoescape by default #6

Closed estahn closed 4 years ago

estahn commented 7 years ago

my.template

{{ TEST }}

Command:

TEST="foo&bar" p2cli -t my.template

Returns:

foo&bar

Expected:

foo&bar
estahn commented 7 years ago

The way around this behaviour is by using autoescape function:

{% autoescape off %}
{{ TEST }}
{% endautoescape %}

Thanks to https://github.com/flosch/pongo2/issues/129#issuecomment-221346740

tushar2708 commented 5 years ago

Would like to add, that It would be really great to have auto-escaping to be off by default. Will help in cases where pongo2 is being used as a near drop-in replacement of Django/Jinja.