handlebars-rust
handlebars-rust copied to clipboard
Chained else expression
Support syntax
{{#if ...}}
{{else if ...}}
{{else}}
{{/if}}
https://github.com/wycats/handlebars.js/pull/892
Is there any workaround currently? I'd like to use this, but unfortunately I'm currently too busy to contribute.
Oops the obvious workaround works. I had an unrelated syntax error because of a typo, which made me think that nesting wouldn't work.
{{#if var1}}
...
{{ else }}{{#if var2}}
...
{{ else }}
...
{{/if}}{{/if}}
Yes.
To support chained else, we may need an update in current parser and helper definition because {{else if ...}}
is incompatible with current model.
Hey @sunng87, any progress on this issue?
@rousan sorry, there is no progress for now.
so, is there any way to add some patches like adding a block helper? It would very helpful then.
@rousan the helper system is totally open. You can register you own block/inline helpers with our API. Checkout examples if you like.
For this chained else, some work needs to be done on the parser and our template structure to support chained inverse template segment. I will probably add support in future releases.
@rousan the helper system is totally open. You can register you own block/inline helpers with our API. Checkout examples if you like.
For this chained else, some work needs to be done on the parser and our template structure to support chained inverse template segment. I will probably add support in future releases.
Anxiously waiting for this feature! Any updates?
@shujaatak Unfortunately there is no progress for this feature. Contributions are welcomed for this.
Any updates?
Fixed in #629
https://crates.io/crates/handlebars version not change?
Released in 5.1.0