fix(vue): preserve custom block (#5458)

master
Ika 2018-11-23 12:33:48 +08:00 committed by GitHub
parent 6ee2f464ac
commit b2eadd234b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 388 additions and 271 deletions

View File

@ -67,9 +67,9 @@ function embed(path, print, textToDoc, options) {
return builders.concat([
concat([
breakParent,
printOpeningTagPrefix(node),
printOpeningTagPrefix(node, options),
markAsRoot(stripTrailingHardline(textToDoc(value, { parser }))),
printClosingTagSuffix(node)
printClosingTagSuffix(node, options)
])
]);
}
@ -245,7 +245,7 @@ function genericPrint(path, options, print) {
])
])
),
printClosingTag(node)
printClosingTag(node, options)
]);
}
case "ieConditionalStartComment":
@ -253,9 +253,9 @@ function genericPrint(path, options, print) {
return concat([printOpeningTagStart(node), printClosingTagEnd(node)]);
case "interpolation":
return concat([
printOpeningTagStart(node),
printOpeningTagStart(node, options),
concat(path.map(print, "children")),
printClosingTagEnd(node)
printClosingTagEnd(node, options)
]);
case "text": {
if (node.parent.type === "interpolation") {
@ -273,9 +273,9 @@ function genericPrint(path, options, print) {
return fill(
normalizeParts(
[].concat(
printOpeningTagPrefix(node),
printOpeningTagPrefix(node, options),
getTextValueParts(node),
printClosingTagSuffix(node)
printClosingTagSuffix(node, options)
)
)
);
@ -284,19 +284,19 @@ function genericPrint(path, options, print) {
return concat([
group(
concat([
printOpeningTagStart(node),
printOpeningTagStart(node, options),
" ",
node.value.replace(/^html\b/i, "html").replace(/\s+/g, " ")
])
),
printClosingTagEnd(node)
printClosingTagEnd(node, options)
]);
case "comment": {
const value = getCommentData(node);
return concat([
group(
concat([
printOpeningTagStart(node),
printOpeningTagStart(node, options),
value.trim().length === 0
? ""
: concat([
@ -318,7 +318,7 @@ function genericPrint(path, options, print) {
])
])
),
printClosingTagEnd(node)
printClosingTagEnd(node, options)
]);
}
case "attribute":
@ -445,7 +445,7 @@ function printChildren(path, options, print) {
if (hasPrettierIgnore(child)) {
return concat(
[].concat(
printOpeningTagPrefix(child),
printOpeningTagPrefix(child, options),
replaceNewlines(
options.originalText.slice(
options.locStart(child) +
@ -455,20 +455,20 @@ function printChildren(path, options, print) {
: 0),
options.locEnd(child) -
(child.next && needsToBorrowPrevClosingTagEndMarker(child.next)
? printClosingTagEndMarker(child).length
? printClosingTagEndMarker(child, options).length
: 0)
),
literalline
),
printClosingTagSuffix(child)
printClosingTagSuffix(child, options)
)
);
}
if (shouldPreserveContent(child)) {
if (shouldPreserveContent(child, options)) {
return concat(
[].concat(
printOpeningTagPrefix(child),
printOpeningTagPrefix(child, options),
group(printOpeningTag(childPath, options, print)),
replaceNewlines(
options.originalText.slice(
@ -480,15 +480,15 @@ function printChildren(path, options, print) {
child.endSourceSpan.start.offset +
(child.lastChild &&
needsToBorrowParentClosingTagStartMarker(child.lastChild)
? printClosingTagStartMarker(child).length
? printClosingTagStartMarker(child, options).length
: needsToBorrowLastChildClosingTagEndMarker(child)
? -printClosingTagEndMarker(child.lastChild).length
? -printClosingTagEndMarker(child.lastChild, options).length
: 0)
),
literalline
),
printClosingTag(child),
printClosingTagSuffix(child)
printClosingTag(child, options),
printClosingTagSuffix(child, options)
)
);
}
@ -557,7 +557,7 @@ function printOpeningTag(path, options, print) {
node.attrs[0].fullName === "src" &&
node.children.length === 0;
return concat([
printOpeningTagStart(node),
printOpeningTagStart(node, options),
!node.attrs || node.attrs.length === 0
? node.isSelfClosing
? /**
@ -630,10 +630,13 @@ function printOpeningTag(path, options, print) {
]);
}
function printOpeningTagStart(node) {
function printOpeningTagStart(node, options) {
return node.prev && needsToBorrowNextOpeningTagStartMarker(node.prev)
? ""
: concat([printOpeningTagPrefix(node), printOpeningTagStartMarker(node)]);
: concat([
printOpeningTagPrefix(node, options),
printOpeningTagStartMarker(node)
]);
}
function printOpeningTagEnd(node) {
@ -643,26 +646,32 @@ function printOpeningTagEnd(node) {
: printOpeningTagEndMarker(node);
}
function printClosingTag(node) {
function printClosingTag(node, options) {
return concat([
node.isSelfClosing ? "" : printClosingTagStart(node),
printClosingTagEnd(node)
node.isSelfClosing ? "" : printClosingTagStart(node, options),
printClosingTagEnd(node, options)
]);
}
function printClosingTagStart(node) {
function printClosingTagStart(node, options) {
return node.lastChild &&
needsToBorrowParentClosingTagStartMarker(node.lastChild)
? ""
: concat([printClosingTagPrefix(node), printClosingTagStartMarker(node)]);
: concat([
printClosingTagPrefix(node, options),
printClosingTagStartMarker(node, options)
]);
}
function printClosingTagEnd(node) {
function printClosingTagEnd(node, options) {
return (node.next
? needsToBorrowPrevClosingTagEndMarker(node.next)
: needsToBorrowLastChildClosingTagEndMarker(node.parent))
? ""
: concat([printClosingTagEndMarker(node), printClosingTagSuffix(node)]);
: concat([
printClosingTagEndMarker(node, options),
printClosingTagSuffix(node, options)
]);
}
function needsToBorrowNextOpeningTagStartMarker(node) {
@ -741,23 +750,23 @@ function needsToBorrowParentClosingTagStartMarker(node) {
);
}
function printOpeningTagPrefix(node) {
function printOpeningTagPrefix(node, options) {
return needsToBorrowParentOpeningTagEndMarker(node)
? printOpeningTagEndMarker(node.parent)
: needsToBorrowPrevClosingTagEndMarker(node)
? printClosingTagEndMarker(node.prev)
? printClosingTagEndMarker(node.prev, options)
: "";
}
function printClosingTagPrefix(node) {
function printClosingTagPrefix(node, options) {
return needsToBorrowLastChildClosingTagEndMarker(node)
? printClosingTagEndMarker(node.lastChild)
? printClosingTagEndMarker(node.lastChild, options)
: "";
}
function printClosingTagSuffix(node) {
function printClosingTagSuffix(node, options) {
return needsToBorrowParentClosingTagStartMarker(node)
? printClosingTagStartMarker(node.parent)
? printClosingTagStartMarker(node.parent, options)
: needsToBorrowNextOpeningTagStartMarker(node)
? printOpeningTagStartMarker(node.next)
: "";
@ -801,9 +810,9 @@ function printOpeningTagEndMarker(node) {
}
}
function printClosingTagStartMarker(node) {
function printClosingTagStartMarker(node, options) {
assert(!node.isSelfClosing);
if (shouldNotPrintClosingTag(node)) {
if (shouldNotPrintClosingTag(node, options)) {
return "";
}
switch (node.type) {
@ -814,8 +823,8 @@ function printClosingTagStartMarker(node) {
}
}
function printClosingTagEndMarker(node) {
if (shouldNotPrintClosingTag(node)) {
function printClosingTagEndMarker(node, options) {
if (shouldNotPrintClosingTag(node, options)) {
return "";
}
switch (node.type) {

View File

@ -34,7 +34,7 @@ function mapObject(object, fn) {
return newObject;
}
function shouldPreserveContent(node) {
function shouldPreserveContent(node, options) {
if (
node.type === "element" &&
node.fullName === "template" &&
@ -61,6 +61,23 @@ function shouldPreserveContent(node) {
return true;
}
// top-level elements (excluding <template>, <style> and <script>) in Vue SFC are considered custom block
// custom blocks can be written in other languages so we should preserve them to not break the code
if (
options.parser === "vue" &&
node.type === "element" &&
node.parent.type === "root" &&
[
"template",
"style",
"script",
// vue parser can be used for vue dom template as well, so we should still format top-level <html>
"html"
].indexOf(node.fullName) === -1
) {
return true;
}
// TODO: handle non-text children in <pre>
if (
isPreLikeNode(node) &&
@ -636,11 +653,11 @@ function identity(x) {
return x;
}
function shouldNotPrintClosingTag(node) {
function shouldNotPrintClosingTag(node, options) {
return (
!node.isSelfClosing &&
!node.endSourceSpan &&
(hasPrettierIgnore(node) || shouldPreserveContent(node.parent))
(hasPrettierIgnore(node) || shouldPreserveContent(node.parent, options))
);
}

View File

@ -1,6 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`attributes.vue - vue-verify 1`] = `
<template>
<div
v-for=" item in items "
v-for=" item of items "
@ -32,66 +33,70 @@ exports[`attributes.vue - vue-verify 1`] = `
}
"
></div>
</template>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div
v-for="item in items"
v-for="item of items"
v-for="(item, index) in items"
v-for="value in object"
v-for="(value, key) in object"
v-for="(value, key) of object"
v-for="(value, key, index) in object"
v-for="n in evenNumbers"
v-for="n in even(numbers)"
v-for="n in 10"
v-for="{ a } in [0].map(() => ({ a: 1 }))"
v-for="({ a }, [c]) in [0].map(() => 1)"
v-for="n in items.map(x => {
return x;
})"
@click="/* hello */"
@click="/* 1 */ $emit(/* 2 */ 'click' /* 3 */) /* 4 */; /* 5 */"
@click="$emit('click');"
@click="$emit('click');"
@click="
$emit('click');
if (something) {
for (let i = j; i < 100; i++) {}
} else {
}
"
slot-scope="{
destructuring: {
a: { b }
}
}"
:class="{
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: true
}"
:class="
(() => {
return 'hello';
})()
"
:key="index /* hello */"
:key="
index // hello
"
@click="
() => {
console.log(test);
}
"
@click="
() => {
console.log(test);
}
"
></div>
<template>
<div
v-for="item in items"
v-for="item of items"
v-for="(item, index) in items"
v-for="value in object"
v-for="(value, key) in object"
v-for="(value, key) of object"
v-for="(value, key, index) in object"
v-for="n in evenNumbers"
v-for="n in even(numbers)"
v-for="n in 10"
v-for="{ a } in [0].map(() => ({ a: 1 }))"
v-for="({ a }, [c]) in [0].map(() => 1)"
v-for="n in items.map(x => {
return x;
})"
@click="/* hello */"
@click="/* 1 */ $emit(/* 2 */ 'click' /* 3 */) /* 4 */; /* 5 */"
@click="$emit('click');"
@click="$emit('click');"
@click="
$emit('click');
if (something) {
for (let i = j; i < 100; i++) {}
} else {
}
"
slot-scope="{
destructuring: {
a: { b }
}
}"
:class="{
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: true
}"
:class="
(() => {
return 'hello';
})()
"
:key="index /* hello */"
:key="
index // hello
"
@click="
() => {
console.log(test);
}
"
@click="
() => {
console.log(test);
}
"
></div>
</template>
`;
exports[`attributes.vue - vue-verify 2`] = `
<template>
<div
v-for=" item in items "
v-for=" item of items "
@ -123,62 +128,65 @@ exports[`attributes.vue - vue-verify 2`] = `
}
"
></div>
</template>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div
v-for="item in items"
v-for="item of items"
v-for="(item, index) in items"
v-for="value in object"
v-for="(value, key) in object"
v-for="(value, key) of object"
v-for="(value, key, index) in object"
v-for="n in evenNumbers"
v-for="n in even(numbers)"
v-for="n in 10"
v-for="{ a } in [0].map(() => ({ a: 1 }))"
v-for="({ a }, [c]) in [0].map(() => 1)"
v-for="n in items.map(x => {
return x;
})"
@click="/* hello */"
@click="/* 1 */ $emit(/* 2 */ 'click' /* 3 */) /* 4 */; /* 5 */"
@click="$emit('click');"
@click="$emit('click');"
@click="
$emit('click');
if (something) {
for (let i = j; i < 100; i++) {}
} else {
}
"
slot-scope="{
destructuring: {
a: { b },
},
}"
:class="{
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: true,
}"
:class="
(() => {
return 'hello';
})()
"
:key="index /* hello */"
:key="
index // hello
"
@click="
() => {
console.log(test);
}
"
@click="
() => {
console.log(test);
}
"
></div>
<template>
<div
v-for="item in items"
v-for="item of items"
v-for="(item, index) in items"
v-for="value in object"
v-for="(value, key) in object"
v-for="(value, key) of object"
v-for="(value, key, index) in object"
v-for="n in evenNumbers"
v-for="n in even(numbers)"
v-for="n in 10"
v-for="{ a } in [0].map(() => ({ a: 1 }))"
v-for="({ a }, [c]) in [0].map(() => 1)"
v-for="n in items.map(x => {
return x;
})"
@click="/* hello */"
@click="/* 1 */ $emit(/* 2 */ 'click' /* 3 */) /* 4 */; /* 5 */"
@click="$emit('click');"
@click="$emit('click');"
@click="
$emit('click');
if (something) {
for (let i = j; i < 100; i++) {}
} else {
}
"
slot-scope="{
destructuring: {
a: { b },
},
}"
:class="{
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: true,
}"
:class="
(() => {
return 'hello';
})()
"
:key="index /* hello */"
:key="
index // hello
"
@click="
() => {
console.log(test);
}
"
@click="
() => {
console.log(test);
}
"
></div>
</template>
`;
@ -498,6 +506,50 @@ export default {
`;
exports[`custom-block.vue - vue-verify 1`] = `
<i18n>
en:
one: One
two: Two
</i18n>
<html><head></head><body></body></html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<i18n>
en:
one: One
two: Two
</i18n>
<html>
<head></head>
<body></body>
</html>
`;
exports[`custom-block.vue - vue-verify 2`] = `
<i18n>
en:
one: One
two: Two
</i18n>
<html><head></head><body></body></html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<i18n>
en:
one: One
two: Two
</i18n>
<html>
<head></head>
<body></body>
</html>
`;
exports[`filter.vue - vue-verify 1`] = `
<!-- vue filters are only allowed in v-bind and interpolation -->
<template>
@ -599,6 +651,7 @@ exports[`filter.vue - vue-verify 2`] = `
`;
exports[`interpolations.vue - vue-verify 1`] = `
<template>
<div>Fuga magnam facilis. Voluptatem quaerat porro.{{
@ -655,18 +708,20 @@ x => {
<div>
1234567890123456789012345678901234567890123456789012345678901234567890 {{ something }} 1234567890
</div>
</template>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div>
Fuga magnam facilis. Voluptatem quaerat porro.{{
x => {
const hello = "world";
return hello;
}
}}
Magni consectetur in et molestias neque esse voluptatibus voluptas.
{{ some_variable }} Eum quia nihil nulla esse. Dolorem asperiores vero est
error
{{
<template>
<div>
Fuga magnam facilis. Voluptatem quaerat porro.{{
x => {
const hello = "world";
return hello;
}
}}
Magni consectetur in et molestias neque esse voluptatibus voluptas.
{{ some_variable }} Eum quia nihil nulla esse. Dolorem asperiores vero est
error
{{
preserve
@ -674,50 +729,52 @@ x => {
interpolation
}}
reprehenderit voluptates minus {{ console.log(short_interpolation) }} nemo.
</div>
}}
reprehenderit voluptates minus {{ console.log(short_interpolation) }} nemo.
</div>
<script type="text/jsx">
export default {
render (h) {
return (
<ul
class={{
'a': b,
'c': d,
"e": f
}}
>
{ this.xyz }
</ul>
)
};
</script>
<script type="text/jsx">
export default {
render (h) {
return (
<ul
class={{
'a': b,
'c': d,
"e": f
}}
>
{ this.xyz }
</ul>
)
};
</script>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890{{
something
}}1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890
{{ something }}1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890{{
something
}}
1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890
{{ something }} 1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890{{
something
}}1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890
{{ something }}1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890{{
something
}}
1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890
{{ something }} 1234567890
</div>
</template>
`;
exports[`interpolations.vue - vue-verify 2`] = `
<template>
<div>Fuga magnam facilis. Voluptatem quaerat porro.{{
@ -774,18 +831,20 @@ x => {
<div>
1234567890123456789012345678901234567890123456789012345678901234567890 {{ something }} 1234567890
</div>
</template>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div>
Fuga magnam facilis. Voluptatem quaerat porro.{{
x => {
const hello = "world";
return hello;
}
}}
Magni consectetur in et molestias neque esse voluptatibus voluptas.
{{ some_variable }} Eum quia nihil nulla esse. Dolorem asperiores vero est
error
{{
<template>
<div>
Fuga magnam facilis. Voluptatem quaerat porro.{{
x => {
const hello = "world";
return hello;
}
}}
Magni consectetur in et molestias neque esse voluptatibus voluptas.
{{ some_variable }} Eum quia nihil nulla esse. Dolorem asperiores vero est
error
{{
preserve
@ -793,50 +852,52 @@ x => {
interpolation
}}
reprehenderit voluptates minus {{ console.log(short_interpolation) }} nemo.
</div>
}}
reprehenderit voluptates minus {{ console.log(short_interpolation) }} nemo.
</div>
<script type="text/jsx">
export default {
render (h) {
return (
<ul
class={{
'a': b,
'c': d,
"e": f
}}
>
{ this.xyz }
</ul>
)
};
</script>
<script type="text/jsx">
export default {
render (h) {
return (
<ul
class={{
'a': b,
'c': d,
"e": f
}}
>
{ this.xyz }
</ul>
)
};
</script>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890{{
something
}}1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890
{{ something }}1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890{{
something
}}
1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890
{{ something }} 1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890{{
something
}}1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890
{{ something }}1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890{{
something
}}
1234567890
</div>
<div>
1234567890123456789012345678901234567890123456789012345678901234567890
{{ something }} 1234567890
</div>
</template>
`;
exports[`pre-child.vue - vue-verify 1`] = `
<template>
<!-- copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/ide/components/jobs/detail.vue -->
<pre
ref="buildTrace"
@ -858,6 +919,7 @@ exports[`pre-child.vue - vue-verify 1`] = `
<div class="dot"></div>
</div>
</pre>
</template>
<!-- copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/vue_shared/components/code_block.vue -->
<template>
@ -879,10 +941,11 @@ exports[`pre-child.vue - vue-verify 1`] = `
</pre>
</template>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<!--
copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/ide/components/jobs/detail.vue
-->
<pre ref="buildTrace" class="build-trace mb-0 h-100" @scroll="scrollBuildLog">
<template>
<!--
copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/ide/components/jobs/detail.vue
-->
<pre ref="buildTrace" class="build-trace mb-0 h-100" @scroll="scrollBuildLog">
<code
v-show="!detailJob.isLoading"
class="bash"
@ -898,6 +961,7 @@ exports[`pre-child.vue - vue-verify 1`] = `
<div class="dot"></div>
</div>
</pre>
</template>
<!--
copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/vue_shared/components/code_block.vue
@ -935,6 +999,7 @@ exports[`pre-child.vue - vue-verify 1`] = `
`;
exports[`pre-child.vue - vue-verify 2`] = `
<template>
<!-- copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/ide/components/jobs/detail.vue -->
<pre
ref="buildTrace"
@ -956,6 +1021,7 @@ exports[`pre-child.vue - vue-verify 2`] = `
<div class="dot"></div>
</div>
</pre>
</template>
<!-- copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/vue_shared/components/code_block.vue -->
<template>
@ -977,10 +1043,11 @@ exports[`pre-child.vue - vue-verify 2`] = `
</pre>
</template>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<!--
copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/ide/components/jobs/detail.vue
-->
<pre ref="buildTrace" class="build-trace mb-0 h-100" @scroll="scrollBuildLog">
<template>
<!--
copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/ide/components/jobs/detail.vue
-->
<pre ref="buildTrace" class="build-trace mb-0 h-100" @scroll="scrollBuildLog">
<code
v-show="!detailJob.isLoading"
class="bash"
@ -996,6 +1063,7 @@ exports[`pre-child.vue - vue-verify 2`] = `
<div class="dot"></div>
</div>
</pre>
</template>
<!--
copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/vue_shared/components/code_block.vue
@ -1059,12 +1127,14 @@ exports[`self_closing.vue - vue-verify 1`] = `
foo( )
</script>
<template>
<div class="container">
<HomeH />
<HomeA />
<HomeX />
<HomeY />
</div>
</template>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<template>
<div />
@ -1074,12 +1144,14 @@ foo( )
foo();
</script>
<div class="container">
<HomeH />
<HomeA />
<HomeX />
<HomeY />
</div>
<template>
<div class="container">
<HomeH />
<HomeA />
<HomeX />
<HomeY />
</div>
</template>
`;
@ -1092,12 +1164,14 @@ exports[`self_closing.vue - vue-verify 2`] = `
foo( )
</script>
<template>
<div class="container">
<HomeH />
<HomeA />
<HomeX />
<HomeY />
</div>
</template>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<template>
<div />
@ -1107,12 +1181,14 @@ foo( )
foo();
</script>
<div class="container">
<HomeH />
<HomeA />
<HomeX />
<HomeY />
</div>
<template>
<div class="container">
<HomeH />
<HomeA />
<HomeX />
<HomeY />
</div>
</template>
`;

View File

@ -1,3 +1,4 @@
<template>
<div
v-for=" item in items "
v-for=" item of items "
@ -29,3 +30,4 @@
}
"
></div>
</template>

View File

@ -0,0 +1,7 @@
<i18n>
en:
one: One
two: Two
</i18n>
<html><head></head><body></body></html>

View File

@ -1,3 +1,4 @@
<template>
<div>Fuga magnam facilis. Voluptatem quaerat porro.{{
@ -54,3 +55,4 @@ x => {
<div>
1234567890123456789012345678901234567890123456789012345678901234567890 {{ something }} 1234567890
</div>
</template>

View File

@ -1,3 +1,4 @@
<template>
<!-- copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/ide/components/jobs/detail.vue -->
<pre
ref="buildTrace"
@ -19,6 +20,7 @@
<div class="dot"></div>
</div>
</pre>
</template>
<!-- copied from https://github.com/gitlabhq/gitlabhq/blob/master/app/assets/javascripts/vue_shared/components/code_block.vue -->
<template>

View File

@ -6,9 +6,11 @@
foo( )
</script>
<template>
<div class="container">
<HomeH />
<HomeA />
<HomeX />
<HomeY />
</div>
</template>