diff --git a/src/language-html/utils.js b/src/language-html/utils.js index 9dd78fecf90c..efa22ccebaab 100644 --- a/src/language-html/utils.js +++ b/src/language-html/utils.js @@ -252,7 +252,11 @@ function isCustomElementWithSurroundingLineBreak(node) { } function isCustomElement(node) { - return node.type === "element" && !node.namespace && node.name.includes("-"); + return ( + node.type === "element" && + !node.namespace && + (node.name.includes("-") || /[A-Z]/.test(node.name[0])) + ); } function hasSurroundingLineBreak(node) { diff --git a/tests/html_attributes/__snapshots__/jsfmt.spec.js.snap b/tests/html_attributes/__snapshots__/jsfmt.spec.js.snap index ec16f2fce22d..89c4b351537b 100644 --- a/tests/html_attributes/__snapshots__/jsfmt.spec.js.snap +++ b/tests/html_attributes/__snapshots__/jsfmt.spec.js.snap @@ -141,7 +141,10 @@ and HTML5 Apps. It also documents Mozilla products, like Firefox OS." data-index-number="12314" data-parent="cars" > - + + + +

+ + + + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~