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

Handlebars.js incompatibilities #509

Closed
vojtechkral opened this issue Jun 6, 2022 · 4 comments · Fixed by #510
Closed

Handlebars.js incompatibilities #509

vojtechkral opened this issue Jun 6, 2022 · 4 comments · Fixed by #510
Labels

Comments

@vojtechkral
Copy link

vojtechkral commented Jun 6, 2022

I've ran into two subtle incompatibilities with the reference implementation

  1. I was accidentally using expression in the shape {{ (helper variable) }}. This syntax is rejected by hbs.js, with hbs-rust it's not rejected and somehow the (string) result of that helper variable expression gets interpreted - when the string contains names of helpers, it will try to evaluate them.
    I found out about this by getting a strange error from inside the ne helper when the string returned by helper variable contained the word "ne".

  2. Whitespace ellision with raw expressions:
    hbs-rust uses the syntax {{{~ foo ~}}} but hbs.js rejects that and instead uses {{~{ foo }~}} ... It looks weird but that's what they use...

@sunng87
Copy link
Owner

sunng87 commented Jun 6, 2022

@vojtechkral Thank you for the detailed report.

For the first case, I might keep the behaviour for backward-compatibility. May I know your use case for {{ (helper variable) }}, or is it just an accidental typo?

For the second case, I'm going to seek if we can support both syntax.

@sunng87 sunng87 added the syntax label Jun 6, 2022
@vojtechkral
Copy link
Author

vojtechkral commented Jun 6, 2022

@sunng87 thank you!

May I know your use case for {{ (helper variable) }}, or is it just an accidental typo?

TBH I don't remember, but I think it was a mistake...

@vojtechkral
Copy link
Author

Awesome, thank you!

@sunng87
Copy link
Owner

sunng87 commented Jun 9, 2022

Thank you. I will create a release soon.

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

Successfully merging a pull request may close this issue.

2 participants