-
Notifications
You must be signed in to change notification settings - Fork 64
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
Triggering bug!
panic with StrVal
s passed to sections
#45
Comments
Empty strings should be handled as "false" as they are a falsy value (see janl/mustache.js#186 for a rationale). |
FYI, the code referenced above seems to be at line 278. |
Does this commit ibabushkin@1bd7ebf satisfy your requirements? If so, I'd open a pull-request. |
Yes please, we'd like a pull request. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given a template such as this one:
and using
as the data passed to the compiled template, I am receiving the following panic:
A code search in the repo yields the following lines in
src/template.rs
as the culprit:Now, the spec doesn't quite specify a clear behaviour on whether string values are to be interpreted as "thruthy", "falsey" or whether this decision is up to the host language's interpretation of this question. Now, in either case, either some filtering at template-compile-time should be done, or strings should be explicitly handled.
I can provide a fix for this (I suggest handling strings as
true
), but I'd like to know how the authors/maintainers see this issue.The text was updated successfully, but these errors were encountered: