File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,15 @@ h1 { color: red }
139
139
expect ( descriptor . template ! . content ) . toBe ( content )
140
140
} )
141
141
142
+ test ( 'treat empty lang attribute as the html' , ( ) => {
143
+ const content = `<div><template v-if="ok">ok</template></div>`
144
+ const { descriptor, errors } = parse (
145
+ `<template lang="">${ content } </template>`
146
+ )
147
+ expect ( descriptor . template ! . content ) . toBe ( content )
148
+ expect ( errors . length ) . toBe ( 0 )
149
+ } )
150
+
142
151
// #1120
143
152
test ( 'alternative template lang should be treated as plain text' , ( ) => {
144
153
const content = `p(v-if="1 < 2") test`
Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ export function parse(
121
121
p . type === NodeTypes . ATTRIBUTE &&
122
122
p . name === 'lang' &&
123
123
p . value &&
124
+ p . value . content &&
124
125
p . value . content !== 'html'
125
126
) )
126
127
) {
You can’t perform that action at this time.
0 commit comments