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
Prettier formats handlebars components incorrectly inside html tag #8584
Comments
For me current output is readable. Why do you think result in expected is better? |
This should not be based on personal information. The parser is breaking the init and ending of the components for no reason. It would be the same of
being formatted like
|
It's funny because if we don't wrap it as a first ancestor with HTML element, then it works as expected. With HTML element it behaves oddly. Funny thing - Input:{{shared/input-component label="The Component" value="description" issue=issue}}
<div>
{{shared/input-component label="The Component" value="description" issue=issue}}
</div> Output:{{shared/input-component label="The Component" value="description" issue=issue}}
<div>
{{
shared/input-component label="The Component" value="description" issue=issue
}}
</div> |
@evilebottnawi Well, to me the main reasons to follow the expected output would be:
Although I understand you guys provide a limited support to the handlebars and it might be outside of the scope |
* Test: Add test addressing #8584 * Fix: Resolves problem with incorrect component formatting (#8584) * Docs: Add changelog note * Test: Add test for yield formatting case * Fix: Fix handlebars yield opening tag break * Test: Add case for any helper with params * Fix: Fix opening tag for every helper with params * Chore: Revert whitespaces * Chore: Revert whitespaces in tests
Prettier 2.0.5
Playground link
Input:
Output:
Expected behavior:
The issue only appears to happen when having an html tag wrapping Ember components, here's the example of prettier working correctly after stripping
<div>
tagThe text was updated successfully, but these errors were encountered: