-
Notifications
You must be signed in to change notification settings - Fork 191
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
Incorrectly removing third curly bracket #1405
Comments
Does the code work before Prettier strips the extra braces? Curlies in that position are considered modifiers not "Mustache statements" so I don't think it can do what you are trying to do. Would something like this work for you? It should have the same result. <input
name="is-active"
type="checkbox"
value="active"
checked={{active}}
/> |
@Windvis Unfortunately the code you shared does not give me the same result. Instead it makes checked equal to either "true" or "false" and To be extra clear as well I am coding in vanilla handlebars, and not using glimmer directly for parsing. I am only using it as a byproduct of it being how prettier formats handlebars files. |
@AW0005 Ah, I see. I assumed you where trying this in an Ember / Glimmer VM project (in which case the code snippet would trigger a build error and the snippet I posted would work as expected). The Handlebars implementation in Ember / Glimmer is not the same as Handlebars.js. Prettier only includes support for the Glimmer subset so you would need a Handelbars.js specific Prettier plugin, but I'm not sure if that exists already. |
@Windvis |
Experiencing this in Prettier's usage of Glimmer as reported here:
prettier/prettier#14090 (comment)
Where they state it is an issue in Glimmer itself.
Trying to add triple curly braces to be able to escape html content, but the third brace is removed if it's inside an html element.
onlyIf
is a custom helper I am using on my project that evaluates on argument one, and then conditionally outputs argument two for context.Input:
Output:
Expected behavior:
Output:
The text was updated successfully, but these errors were encountered: