Fix self-closing style tags in vue (#4108)
commit
f6f6f2e2ea
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -340,6 +340,36 @@ foo();
|
|||
|
||||
`;
|
||||
|
||||
exports[`self_closing_style.vue 1`] = `
|
||||
<template>
|
||||
<span :class="$style.root"><slot /></span>
|
||||
</template>
|
||||
|
||||
<style src="./style.css" module />
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<template>
|
||||
<span :class="$style.root"><slot /></span>
|
||||
</template>
|
||||
|
||||
<style src="./style.css" module />
|
||||
|
||||
`;
|
||||
|
||||
exports[`self_closing_style.vue 2`] = `
|
||||
<template>
|
||||
<span :class="$style.root"><slot /></span>
|
||||
</template>
|
||||
|
||||
<style src="./style.css" module />
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<template>
|
||||
<span :class="$style.root"><slot /></span>
|
||||
</template>
|
||||
|
||||
<style src="./style.css" module />
|
||||
|
||||
`;
|
||||
|
||||
exports[`test.vue 1`] = `
|
||||
<script>
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<template>
|
||||
<span :class="$style.root"><slot /></span>
|
||||
</template>
|
||||
|
||||
<style src="./style.css" module />
|
Loading…
Reference in New Issue