diff --git a/changelog_unreleased/vue/12394.md b/changelog_unreleased/vue/12394.md
new file mode 100644
index 000000000..2d85bdb1f
--- /dev/null
+++ b/changelog_unreleased/vue/12394.md
@@ -0,0 +1,49 @@
+#### Allow `lang` attribute of `` to be empty (#12394 by @HallvardMM)
+
+Template tag should allow empty string lang="" or undefined lang
+
+
+```vue
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+SyntaxError: Unexpected closing tag "v-menu". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (5:5)
+[error] 3 |
+[error] 4 |
+[error] > 5 |
+[error] | ^^^^^^^^^
+[error] 6 |
+[error] 7 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
diff --git a/src/language-html/parser-html.js b/src/language-html/parser-html.js
index b438eaa35..5763fe7c7 100644
--- a/src/language-html/parser-html.js
+++ b/src/language-html/parser-html.js
@@ -421,7 +421,11 @@ module.exports = {
!hasParent &&
(tagName !== "template" ||
attrs.some(
- ({ name, value }) => name === "lang" && value !== "html"
+ ({ name, value }) =>
+ name === "lang" &&
+ value !== "html" &&
+ value !== "" &&
+ value !== undefined
))
) {
return require("angular-html-parser").TagContentType.RAW_TEXT;
diff --git a/tests/format/vue/vue/__snapshots__/jsfmt.spec.js.snap b/tests/format/vue/vue/__snapshots__/jsfmt.spec.js.snap
index c121080d9..572405782 100644
--- a/tests/format/vue/vue/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/format/vue/vue/__snapshots__/jsfmt.spec.js.snap
@@ -4154,6 +4154,22 @@ semi: false
some-component(tag='')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
=====================================output=====================================
.test
@@ -4172,6 +4188,22 @@ semi: false
some-component(tag='')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
================================================================================
`;
@@ -4203,6 +4235,22 @@ trailingComma: "none"
some-component(tag='')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
=====================================output=====================================
.test
@@ -4221,6 +4269,22 @@ trailingComma: "none"
some-component(tag='')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
================================================================================
`;
@@ -4251,6 +4315,22 @@ printWidth: 80
some-component(tag='')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
=====================================output=====================================
.test
@@ -4269,6 +4349,22 @@ printWidth: 80
some-component(tag='')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
================================================================================
`;
diff --git a/tests/format/vue/vue/template-lang.vue b/tests/format/vue/vue/template-lang.vue
index 55bf0c2fb..b53b7646e 100644
--- a/tests/format/vue/vue/template-lang.vue
+++ b/tests/format/vue/vue/template-lang.vue
@@ -18,3 +18,19 @@
#container
some-component(tag='')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+