We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
{{#if null}}
I found strange behavior.
Object key that started "null" is interpreted as false in spite of it's value is true. Is that a specification?
[dependencies] handlebars = "3.4.0" serde_json = "1.0.57"
extern crate handlebars; #[macro_use] extern crate serde_json; use handlebars::Handlebars; fn main() -> Result<(), Box<dyn std::error::Error>> { let reg = Handlebars::new(); let data = json!({ "optional": true, "is_null": true, "nullable": true, "null": true, }); println!( "{}", reg.render_template("optional: {{optional}} --> {{#if optional }}true{{else}}false{{/if}}", &data)? ); println!( "{}", reg.render_template("is_null: {{is_null}} --> {{#if is_null }}true{{else}}false{{/if}}", &data)? ); println!( "{}", reg.render_template("nullable: {{nullable}} --> {{#if nullable }}true{{else}}false{{/if}}", &data)? ); println!( "{}", reg.render_template("null: {{null}} --> {{#if null }}true{{else}}false{{/if}}", &data)? ); Ok(()) }
The result is here.
optional: true --> true is_null: true --> true nullable: true --> false null: true --> false
The text was updated successfully, but these errors were encountered:
This seems to be a bug with our parser. Let me look into it.
Sorry, something went wrong.
(test) add test to reproduce #381
ec3ba02
Successfully merging a pull request may close this issue.
I found strange behavior.
Object key that started "null" is interpreted as false in spite of it's value is true.
Is that a specification?
The result is here.
The text was updated successfully, but these errors were encountered: