Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat null values as falsey in inverted sections #63

Merged
merged 1 commit into from
Apr 30, 2023

Conversation

TheInnerLight
Copy link
Contributor

@TheInnerLight TheInnerLight commented Feb 2, 2023

This PR changes the handle of the null values.

If some supplied value takes a null value and we have two cases:

Case 1:

{{#value}}
    Something.
{{/value}}

Case 2:

{{^value}}
    Something.
{{/value}}

Both cases currently result in nothing being rendered.

This PR changes this such that, in Case 2, "Something" is rendered. This change ensures conformance with the mustache spec which clarifies that for null values in inverted sections, the text should be rendered (https://github.com/mustache/spec/blob/master/specs/inverted.yml#L49) as discussed in this issue.

@JustusAdam JustusAdam merged commit 47759ca into JustusAdam:master Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants