Skip to content

Support for stripping whitespaces? #2

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions