diff --git a/src/language-vue/embed.js b/src/language-vue/embed.js
index 2f73eb757..bcb37bee8 100644
--- a/src/language-vue/embed.js
+++ b/src/language-vue/embed.js
@@ -7,7 +7,7 @@ const hardline = docBuilders.hardline;
function embed(path, print, textToDoc, options) {
const node = path.getValue();
const parent = path.getParentNode();
- if (!parent || parent.tag !== "root") {
+ if (!parent || parent.tag !== "root" || node.unary) {
return null;
}
diff --git a/tests/vue_examples/__snapshots__/jsfmt.spec.js.snap b/tests/vue_examples/__snapshots__/jsfmt.spec.js.snap
index e84c48b14..d62526337 100644
--- a/tests/vue_examples/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/vue_examples/__snapshots__/jsfmt.spec.js.snap
@@ -340,6 +340,36 @@ foo();
`;
+exports[`self_closing_style.vue 1`] = `
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+
+
+
+
+`;
+
+exports[`self_closing_style.vue 2`] = `
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+
+
+
+
+`;
+
exports[`test.vue 1`] = `
diff --git a/tests/vue_examples/self_closing_style.vue b/tests/vue_examples/self_closing_style.vue
new file mode 100644
index 000000000..fa9f07004
--- /dev/null
+++ b/tests/vue_examples/self_closing_style.vue
@@ -0,0 +1,5 @@
+
+
+
+
+