Skip to content

Support for stripping whitespaces? #2

@lemonboston

Description

@lemonboston

Hi,

Is there any way to strip whitespaces as in jinpa?:
http://jinja.pocoo.org/docs/2.9/templates/#whitespace-control

I have template containing lines like this:

{% if hasPrivacy %}{{ privacyKey }}: {{ privacy }}{% end %}
{% if hasStatus %}{{ statusKey }}: {{ status }}{% end %}
{% if hasUrl %}{{ url }}{% end %}

But even if the has* property is false an empty line is added and I need to avoid that.
I tried the - signs inside the if, end tags but I got exception.
Do you maybe have any tip how to solve this in other way?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions