feat(html): treat capital element as custom element (#5395)
Custom element: keep it on its own line if both leading/trailing line breaks existmaster
parent
0228863a92
commit
9acb02997a
|
@ -254,7 +254,11 @@ function isCustomElementWithSurroundingLineBreak(node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isCustomElement(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) {
|
function hasSurroundingLineBreak(node) {
|
||||||
|
|
|
@ -141,7 +141,10 @@ and HTML5 Apps. It also documents Mozilla products, like Firefox OS."
|
||||||
data-index-number="12314"
|
data-index-number="12314"
|
||||||
data-parent="cars"
|
data-parent="cars"
|
||||||
></article>
|
></article>
|
||||||
<X> </X> <X a="1"> </X> <X a="1" b="2"> </X> <X a="1" b="2" c="3"> </X>
|
<X> </X>
|
||||||
|
<X a="1"> </X>
|
||||||
|
<X a="1" b="2"> </X>
|
||||||
|
<X a="1" b="2" c="3"> </X>
|
||||||
<p
|
<p
|
||||||
class="
|
class="
|
||||||
foo
|
foo
|
||||||
|
|
|
@ -1034,6 +1034,13 @@ exports[`self_closing.vue - vue-verify 1`] = `
|
||||||
<script>
|
<script>
|
||||||
foo( )
|
foo( )
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<HomeH />
|
||||||
|
<HomeA />
|
||||||
|
<HomeX />
|
||||||
|
<HomeY />
|
||||||
|
</div>
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
<template>
|
<template>
|
||||||
<div />
|
<div />
|
||||||
|
@ -1043,6 +1050,13 @@ foo( )
|
||||||
foo();
|
foo();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<HomeH />
|
||||||
|
<HomeA />
|
||||||
|
<HomeX />
|
||||||
|
<HomeY />
|
||||||
|
</div>
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`self_closing.vue - vue-verify 2`] = `
|
exports[`self_closing.vue - vue-verify 2`] = `
|
||||||
|
@ -1053,6 +1067,13 @@ exports[`self_closing.vue - vue-verify 2`] = `
|
||||||
<script>
|
<script>
|
||||||
foo( )
|
foo( )
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<HomeH />
|
||||||
|
<HomeA />
|
||||||
|
<HomeX />
|
||||||
|
<HomeY />
|
||||||
|
</div>
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
<template>
|
<template>
|
||||||
<div />
|
<div />
|
||||||
|
@ -1062,6 +1083,13 @@ foo( )
|
||||||
foo();
|
foo();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<HomeH />
|
||||||
|
<HomeA />
|
||||||
|
<HomeX />
|
||||||
|
<HomeY />
|
||||||
|
</div>
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`self_closing_style.vue - vue-verify 1`] = `
|
exports[`self_closing_style.vue - vue-verify 1`] = `
|
||||||
|
|
|
@ -5,3 +5,10 @@
|
||||||
<script>
|
<script>
|
||||||
foo( )
|
foo( )
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<HomeH />
|
||||||
|
<HomeA />
|
||||||
|
<HomeX />
|
||||||
|
<HomeY />
|
||||||
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue