File tree 1 file changed +10
-10
lines changed
packages/compiler-core/src
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -96,8 +96,8 @@ export interface ParserContext {
96
96
offset : number
97
97
line : number
98
98
column : number
99
- inPre : number // HTML <pre> tag, preserve whitespaces
100
- inVPre : number // v-pre, do not process directives and interpolations
99
+ inPre : boolean // HTML <pre> tag, preserve whitespaces
100
+ inVPre : boolean // v-pre, do not process directives and interpolations
101
101
onWarn : NonNullable < ErrorHandlingOptions [ 'onWarn' ] >
102
102
}
103
103
@@ -134,8 +134,8 @@ function createParserContext(
134
134
offset : 0 ,
135
135
originalSource : content ,
136
136
source : content ,
137
- inPre : 0 ,
138
- inVPre : 0 ,
137
+ inPre : false ,
138
+ inVPre : false ,
139
139
onWarn : options . onWarn
140
140
}
141
141
}
@@ -427,8 +427,8 @@ function parseElement(
427
427
428
428
if ( element . isSelfClosing || context . options . isVoidTag ( element . tag ) ) {
429
429
// #4030 self-closing <pre> tag
430
- if ( context . options . isPreTag ( element . tag ) ) {
431
- context . inPre --
430
+ if ( isPreBoundary ) {
431
+ context . inPre = false
432
432
}
433
433
return element
434
434
}
@@ -479,10 +479,10 @@ function parseElement(
479
479
element . loc = getSelection ( context , element . loc . start )
480
480
481
481
if ( isPreBoundary ) {
482
- context . inPre --
482
+ context . inPre = false
483
483
}
484
484
if ( isVPreBoundary ) {
485
- context . inVPre --
485
+ context . inVPre = false
486
486
}
487
487
return element
488
488
}
@@ -535,7 +535,7 @@ function parseTag(
535
535
536
536
// check <pre> tag
537
537
if ( context . options . isPreTag ( tag ) ) {
538
- context . inPre ++
538
+ context . inPre = true
539
539
}
540
540
541
541
// Attributes.
@@ -547,7 +547,7 @@ function parseTag(
547
547
! context . inVPre &&
548
548
props . some ( p => p . type === NodeTypes . DIRECTIVE && p . name === 'pre' )
549
549
) {
550
- context . inVPre ++
550
+ context . inVPre = true
551
551
// reset context
552
552
extend ( context , cursor )
553
553
context . source = currentSource
You can’t perform that action at this time.
0 commit comments