offset: number
line: number
column: number
- inPre: number // HTML <pre> tag, preserve whitespaces
- inVPre: number // v-pre, do not process directives and interpolations
+ inPre: boolean // HTML <pre> tag, preserve whitespaces
+ inVPre: boolean // v-pre, do not process directives and interpolations
onWarn: NonNullable<ErrorHandlingOptions['onWarn']>
}
offset: 0,
originalSource: content,
source: content,
- inPre: 0,
- inVPre: 0,
+ inPre: false,
+ inVPre: false,
onWarn: options.onWarn
}
}
if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
// #4030 self-closing <pre> tag
- if (context.options.isPreTag(element.tag)) {
- context.inPre--
+ if (isPreBoundary) {
+ context.inPre = false
}
return element
}
element.loc = getSelection(context, element.loc.start)
if (isPreBoundary) {
- context.inPre--
+ context.inPre = false
}
if (isVPreBoundary) {
- context.inVPre--
+ context.inVPre = false
}
return element
}
// check <pre> tag
if (context.options.isPreTag(tag)) {
- context.inPre++
+ context.inPre = true
}
// Attributes.
!context.inVPre &&
props.some(p => p.type === NodeTypes.DIRECTIVE && p.name === 'pre')
) {
- context.inVPre++
+ context.inVPre = true
// reset context
extend(context, cursor)
context.source = currentSource