handlebars-rust icon indicating copy to clipboard operation
handlebars-rust copied to clipboard

How to use square brackets when calling helper?

Open ysthakur opened this issue 3 years ago • 1 comments

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?

ysthakur avatar Dec 20 '22 21:12 ysthakur

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

sunng87 avatar Jan 21 '23 05:01 sunng87