File tree 1 file changed +13
-7
lines changed
packages/compiler-sfc/__tests__
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -144,14 +144,10 @@ h1 { color: red }
144
144
expect ( descriptor . template ! . content ) . toBe ( content )
145
145
} )
146
146
147
- test ( 'error tolerance' , ( ) => {
148
- const { errors } = parse ( `<template>` )
149
- expect ( errors . length ) . toBe ( 1 )
150
- } )
151
-
152
- test ( 'should parse as DOM by default' , ( ) => {
147
+ //#2566
148
+ test ( 'only template lang be treated as plain text' , ( ) => {
153
149
const { errors } = parse ( `
154
- <template>
150
+ <template lang="pug" >
155
151
<div lang="">
156
152
<div></div>
157
153
</div>
@@ -160,6 +156,16 @@ h1 { color: red }
160
156
expect ( errors . length ) . toBe ( 0 )
161
157
} )
162
158
159
+ test ( 'error tolerance' , ( ) => {
160
+ const { errors } = parse ( `<template>` )
161
+ expect ( errors . length ) . toBe ( 1 )
162
+ } )
163
+
164
+ test ( 'should parse as DOM by default' , ( ) => {
165
+ const { errors } = parse ( `<template><input></template>` )
166
+ expect ( errors . length ) . toBe ( 0 )
167
+ } )
168
+
163
169
test ( 'custom compiler' , ( ) => {
164
170
const { errors } = parse ( `<template><input></template>` , {
165
171
compiler : {
You can’t perform that action at this time.
0 commit comments