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

Ember handlebars formatting doesn't allow for self-closing tags #13624

Closed
ArnaudWeyts opened this issue Oct 12, 2022 · 2 comments · Fixed by #13691
Closed

Ember handlebars formatting doesn't allow for self-closing tags #13624

ArnaudWeyts opened this issue Oct 12, 2022 · 2 comments · Fixed by #13691
Labels
lang:handlebars Issues affecting Handlebars (Glimmer) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:enhancement A potential new feature to be added, or an improvement to how we print something

Comments

@ArnaudWeyts
Copy link

Prettier 2.7.1
Playground link

Input:

<div />
<custom-component />

Output:

<div></div>
<custom-component></custom-component>

Expected behavior:

<div />
<custom-component />

Ember allows for self-closing tags (see docs), but prettier with the glimmer parser adds closing tags instead. I'm not sure if this was a conscious decision, because the JSX parser does convert closing tags.

@ArnaudWeyts ArnaudWeyts changed the title Ember handeblars formatting doesn't allow for self-closing tags Ember handlebars formatting doesn't allow for self-closing tags Oct 12, 2022
@thorn0
Copy link
Member

thorn0 commented Oct 13, 2022

@dcyriller Could you comment on this please?

@thorn0 thorn0 added the lang:handlebars Issues affecting Handlebars (Glimmer) label Oct 13, 2022
@dcyriller
Copy link
Collaborator

If it is supported in Ember as per the documentation, it could be added to Prettier? opened #13691

@thorn0 thorn0 added the type:enhancement A potential new feature to be added, or an improvement to how we print something label Oct 20, 2022
@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Nov 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:handlebars Issues affecting Handlebars (Glimmer) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:enhancement A potential new feature to be added, or an improvement to how we print something
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants