File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,25 @@ export function parse (
52
52
transforms = pluckModuleFunction ( options . modules , 'transformNode' )
53
53
postTransforms = pluckModuleFunction ( options . modules , 'postTransformNode' )
54
54
delimiters = options . delimiters
55
+
55
56
const stack = [ ]
56
57
const preserveWhitespace = options . preserveWhitespace !== false
57
58
let root
58
59
let currentParent
59
60
let inVPre = false
60
61
let inPre = false
61
62
let warned = false
63
+
64
+ function endPre ( element ) {
65
+ // check pre state
66
+ if ( element . pre ) {
67
+ inVPre = false
68
+ }
69
+ if ( platformIsPreTag ( element . tag ) ) {
70
+ inPre = false
71
+ }
72
+ }
73
+
62
74
parseHTML ( template , {
63
75
expectHTML : options . expectHTML ,
64
76
isUnaryTag : options . isUnaryTag ,
@@ -186,6 +198,8 @@ export function parse (
186
198
if ( ! unary ) {
187
199
currentParent = element
188
200
stack . push ( element )
201
+ } else {
202
+ endPre ( element )
189
203
}
190
204
// apply post-transforms
191
205
for ( let i = 0 ; i < postTransforms . length ; i ++ ) {
@@ -203,13 +217,7 @@ export function parse (
203
217
// pop stack
204
218
stack . length -= 1
205
219
currentParent = stack [ stack . length - 1 ]
206
- // check pre state
207
- if ( element . pre ) {
208
- inVPre = false
209
- }
210
- if ( platformIsPreTag ( element . tag ) ) {
211
- inPre = false
212
- }
220
+ endPre ( element )
213
221
} ,
214
222
215
223
chars ( text : string ) {
You can’t perform that action at this time.
0 commit comments