File tree 2 files changed +15
-8
lines changed
2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,13 @@ h1 { color: red }
150
150
} )
151
151
152
152
test ( 'should parse as DOM by default' , ( ) => {
153
- const { errors } = parse ( `<template><input></template>` )
153
+ const { errors } = parse ( `
154
+ <template>
155
+ <div lang="">
156
+ <div></div>
157
+ </div>
158
+ </template>
159
+ ` )
154
160
expect ( errors . length ) . toBe ( 0 )
155
161
} )
156
162
Original file line number Diff line number Diff line change @@ -112,13 +112,14 @@ export function parse(
112
112
if (
113
113
( ! parent && tag !== 'template' ) ||
114
114
// <template lang="xxx"> should also be treated as raw text
115
- props . some (
116
- p =>
117
- p . type === NodeTypes . ATTRIBUTE &&
118
- p . name === 'lang' &&
119
- p . value &&
120
- p . value . content !== 'html'
121
- )
115
+ ( tag === 'template' &&
116
+ props . some (
117
+ p =>
118
+ p . type === NodeTypes . ATTRIBUTE &&
119
+ p . name === 'lang' &&
120
+ p . value &&
121
+ p . value . content !== 'html'
122
+ ) )
122
123
) {
123
124
return TextModes . RAWTEXT
124
125
} else {
You can’t perform that action at this time.
0 commit comments