@@ -63,7 +63,7 @@ export function parseHTML (html, handler) {
63
63
const expectHTML = handler . expectHTML
64
64
const isUnaryTag = handler . isUnaryTag || no
65
65
const isSpecialTag = handler . isSpecialTag || special
66
- let last , prevTag , nextTag , lastTag
66
+ let last , lastTag
67
67
while ( html ) {
68
68
last = html
69
69
// Make sure we're not in a script or style element
@@ -76,7 +76,6 @@ export function parseHTML (html, handler) {
76
76
77
77
if ( commentEnd >= 0 ) {
78
78
html = html . substring ( commentEnd + 3 )
79
- prevTag = ''
80
79
continue
81
80
}
82
81
}
@@ -87,7 +86,6 @@ export function parseHTML (html, handler) {
87
86
88
87
if ( conditionalEnd >= 0 ) {
89
88
html = html . substring ( conditionalEnd + 2 )
90
- prevTag = ''
91
89
continue
92
90
}
93
91
}
@@ -99,7 +97,6 @@ export function parseHTML (html, handler) {
99
97
handler . doctype ( doctypeMatch [ 0 ] )
100
98
}
101
99
html = html . substring ( doctypeMatch [ 0 ] . length )
102
- prevTag = ''
103
100
continue
104
101
}
105
102
@@ -108,7 +105,6 @@ export function parseHTML (html, handler) {
108
105
if ( endTagMatch ) {
109
106
html = html . substring ( endTagMatch [ 0 ] . length )
110
107
endTagMatch [ 0 ] . replace ( endTag , parseEndTag )
111
- prevTag = '/' + endTagMatch [ 1 ] . toLowerCase ( )
112
108
continue
113
109
}
114
110
@@ -117,7 +113,6 @@ export function parseHTML (html, handler) {
117
113
if ( startTagMatch ) {
118
114
html = startTagMatch . rest
119
115
handleStartTag ( startTagMatch )
120
- prevTag = startTagMatch . tagName . toLowerCase ( )
121
116
continue
122
117
}
123
118
}
@@ -131,23 +126,9 @@ export function parseHTML (html, handler) {
131
126
html = ''
132
127
}
133
128
134
- // next tag
135
- let nextTagMatch = parseStartTag ( html )
136
- if ( nextTagMatch ) {
137
- nextTag = nextTagMatch . tagName
138
- } else {
139
- nextTagMatch = html . match ( endTag )
140
- if ( nextTagMatch ) {
141
- nextTag = '/' + nextTagMatch [ 1 ]
142
- } else {
143
- nextTag = ''
144
- }
145
- }
146
-
147
129
if ( handler . chars ) {
148
- handler . chars ( text , prevTag , nextTag )
130
+ handler . chars ( text )
149
131
}
150
- prevTag = ''
151
132
} else {
152
133
const stackedTag = lastTag . toLowerCase ( )
153
134
const reStackedTag = reCache [ stackedTag ] || ( reCache [ stackedTag ] = new RegExp ( '([\\s\\S]*?)</' + stackedTag + '[^>]*>' , 'i' ) )
0 commit comments