Skip to content
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

If-Else block allow multiple else blocks #1121

Open
sshailabh opened this issue Apr 23, 2024 · 1 comment
Open

If-Else block allow multiple else blocks #1121

sshailabh opened this issue Apr 23, 2024 · 1 comment

Comments

@sshailabh
Copy link

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.
image

@sshailabh
Copy link
Author

Fixing the issue with this pr: #1154
Here, changed the parser grammar to disallow multiple else statements. Please check the description for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant