Skip to content

inverted sections where value is an empty string #186

@appmode

Description

@appmode

If value is an empty string it is not matched by either a section or an inverted section.

value = ""

{{#value}}
value is {{value}}
{{/value}}
{{^value}}
value is empty
{{/value}}

will output nothing.

The man page says:
A section will be rendered if it "has a non-false value"
An inverted section "will be rendered if the key doesn't exist, is false, or is an empty list."

An empty string equates to false and therefore the expected behaviour would be for an empty string to be matched by an inverted section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions