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

How to use square brackets when calling helper? #552

Open
ysthakur opened this issue Dec 20, 2022 · 1 comment
Open

How to use square brackets when calling helper? #552

ysthakur opened this issue Dec 20, 2022 · 1 comment
Labels

Comments

@ysthakur
Copy link

I can't figure out how to use square brackets to refer to a helper. While fuzzing, a template like {{[\0] ''}} failed and said there was no helper named \0 even though it was defined. However, when I used the same template and defined a helper named [\0], it worked.

Naming the helper \0 works in the Handlebars.js playground but naming it [\0] doesn't, so I'm not sure why the opposite is true for handlebars-rust.

Question

What am I doing wrong? I used handlebars.register_helper to register the helper. Is it supposed to be done some other way?

@sunng87
Copy link
Owner

sunng87 commented Jan 21, 2023

hmm.. this syntax is not supported by handlebars-rust. We will need special treatment for this [] syntax

@sunng87 sunng87 added the syntax label Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants