-
Notifications
You must be signed in to change notification settings - Fork 33
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
Inverted sections don't render with null values #40
Comments
Which implementations specifically? If this is not in the standard I don't feel comfortable including it here unless it really is a standard feature of a significant majority of mustache implementations. |
I happened to be depending on the cli tool in https://github.com/mustache/mustache. Which standard is this implementation conforming to? The quote above says "is false", but that could mean "is the json false value" or "is falsey in according to the source language". This spec https://github.com/mustache/spec refers to falsey. |
Version 1.1.3, which as of this comment is still current. My travis setup for this repository actually pulls the spec you are linking to and tests against their test suite. |
This spec: https://github.com/mustache/spec/blob/master/specs/inverted.yml doesn't have any test cases for what I am describing. However, it does state this:
Whilst this is language specific and a bit vague, I'm not aware of any language where a json null value is considered truthy. |
I too was just now bitten by this issue. It seems more than a bit strange that For instance:
It seems that one of the two lines should be rendered. But if I'll also point out that in both the original ruby implementation and in mustache.js, Note too that by a strict reading of the spec there appears no requirement that |
The spec has now been updated to cover this case (https://github.com/mustache/spec/blob/master/specs/inverted.yml#L49).
I will submit a PR to make this change. |
Somehow I missed a lot of this discussion. Sorry for the absence. I'll review the PR in a bit. |
In other mustache implementations, a value of
null
triggers an inverted section. However in this one, that is not that case.This would work, I think, if the code was changed to:
However, to my surprise, it seems that the standard (https://mustache.github.io/mustache.5.html) does not specify this:
The text was updated successfully, but these errors were encountered: