handlebars.java
handlebars.java copied to clipboard
If-Else block allow multiple else blocks
In conditional block, multiple else are allowed in the template. This should throw an error on compilation. Sample example:
{{#if author}}
If block
{{else}}
Else 1
{{else}}
Else 2
{{/if}}
Handlebar.js is able to catch multiple else statements. Below is the error generated there.
Fixing the issue with this pr: https://github.com/jknack/handlebars.java/pull/1154 Here, changed the parser grammar to disallow multiple else statements. Please check the description for more details.