Skip to content

Commit

Permalink
Add a failing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
dcyriller committed Oct 20, 2022
1 parent f38111f commit 77d53fa
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/language-handlebars/utils.js
Expand Up @@ -41,6 +41,7 @@ const voidTags = new Set(htmlVoidElements);
function isVoid(node) {
return (
voidTags.has(node.tag) ||
node.selfClosing === true ||
(isGlimmerComponent(node) &&
node.children.every((node) => isWhitespaceNode(node)))
);
Expand Down
Expand Up @@ -45,6 +45,11 @@ printWidth: 80
<MyComponent @prop={{true}} @prop2={{true}} @prop3={{true}} @prop4={{true}} as |thing|></MyComponent>
<div />
<custom-component />
<i />
<Component />
=====================================output=====================================
<div class="attribute" {{modifier}} {{! comment}}>
Hello
Expand Down Expand Up @@ -91,5 +96,10 @@ printWidth: 80
@prop4={{true}}
as |thing|
/>
<div />
<custom-component />
<i />
<Component />
================================================================================
`;
5 changes: 5 additions & 0 deletions tests/format/handlebars/element-node/element-node.hbs
Expand Up @@ -36,3 +36,8 @@
<img />

<MyComponent @prop={{true}} @prop2={{true}} @prop3={{true}} @prop4={{true}} as |thing|></MyComponent>

<div />
<custom-component />
<i />
<Component />
Expand Up @@ -702,7 +702,7 @@ printWidth: 40
=====================================input======================================
<i />   |   <i />
=====================================output=====================================
<i></i>   |   <i></i>
<i />   |   <i />
================================================================================
`;

Expand Down
Expand Up @@ -99,8 +99,8 @@ singleQuote: false
<div title='My "title"'></div>
<div title="My other 'title'"></div>
<div title="{{t 'my.title'}}"></div>
<div title="{{t 'my.title'}}"></div>
<div title="{{t 'my.title'}}" />
<div title="{{t 'my.title'}}" />
<a href="/{{url}}/{{url}}"></a>
<a href="/{{url}}/{{url}}"></a>
Expand All @@ -126,7 +126,7 @@ singleQuote: false
class="padding
{{if foo (if fooAgain 'bar' (if fooAgainAgain 'bar' 'foo'))}}
baz"
></div>
/>
================================================================================
`;

Expand Down Expand Up @@ -161,8 +161,8 @@ singleQuote: true
<div title='My "title"'></div>
<div title="My other 'title'"></div>
<div title='{{t "my.title"}}'></div>
<div title='{{t "my.title"}}'></div>
<div title='{{t "my.title"}}' />
<div title='{{t "my.title"}}' />
<a href='/{{url}}/{{url}}'></a>
<a href='/{{url}}/{{url}}'></a>
Expand All @@ -188,7 +188,7 @@ singleQuote: true
class='padding
{{if foo (if fooAgain "bar" (if fooAgainAgain "bar" "foo"))}}
baz'
></div>
/>
================================================================================
`;

Expand Down

0 comments on commit 77d53fa

Please sign in to comment.