diff --git a/src/language-handlebars/utils.js b/src/language-handlebars/utils.js index 07e4c57544f6..aef7f46f813f 100644 --- a/src/language-handlebars/utils.js +++ b/src/language-handlebars/utils.js @@ -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))) ); diff --git a/tests/format/handlebars/element-node/__snapshots__/jsfmt.spec.js.snap b/tests/format/handlebars/element-node/__snapshots__/jsfmt.spec.js.snap index c11ac99ba176..5fe00cbbdb7c 100644 --- a/tests/format/handlebars/element-node/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/handlebars/element-node/__snapshots__/jsfmt.spec.js.snap @@ -95,7 +95,7 @@ printWidth: 80 as |thing| /> -
- +
+ ================================================================================ `; diff --git a/tests/format/handlebars/html-whitespace-sensitivity/__snapshots__/jsfmt.spec.js.snap b/tests/format/handlebars/html-whitespace-sensitivity/__snapshots__/jsfmt.spec.js.snap index 33cc64a9404a..73daa2ee6685 100644 --- a/tests/format/handlebars/html-whitespace-sensitivity/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/handlebars/html-whitespace-sensitivity/__snapshots__/jsfmt.spec.js.snap @@ -702,7 +702,7 @@ printWidth: 40 =====================================input======================================   |   =====================================output===================================== -   |   +   |   ================================================================================ `; diff --git a/tests/format/handlebars/single-quote-option/__snapshots__/jsfmt.spec.js.snap b/tests/format/handlebars/single-quote-option/__snapshots__/jsfmt.spec.js.snap index 4229856d7e11..a26517e85ba6 100644 --- a/tests/format/handlebars/single-quote-option/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/handlebars/single-quote-option/__snapshots__/jsfmt.spec.js.snap @@ -99,8 +99,8 @@ singleQuote: false
-
-
+
+
@@ -126,7 +126,7 @@ singleQuote: false class="padding {{if foo (if fooAgain 'bar' (if fooAgainAgain 'bar' 'foo'))}} baz" ->
+/> ================================================================================ `; @@ -161,8 +161,8 @@ singleQuote: true
-
-
+
+
@@ -188,7 +188,7 @@ singleQuote: true class='padding {{if foo (if fooAgain "bar" (if fooAgainAgain "bar" "foo"))}} baz' ->
+/> ================================================================================ `;