File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/html5lib/treebuilders Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -157,19 +157,18 @@ def reconstructActiveFormattingElements(self):
157
157
return
158
158
159
159
# Step 2 and step 3: we start with the last element. So i is -1.
160
- i = - 1
160
+ i = len ( self . activeFormattingElements ) - 1
161
161
entry = self .activeFormattingElements [i ]
162
162
if entry == Marker or entry in self .openElements :
163
163
return
164
164
165
165
# Step 6
166
166
while entry != Marker and entry not in self .openElements :
167
- i -= 1
168
- if i < 0 :
169
- # Step 4: at this point we need to jump to step 8.
170
- # So we reset the index to 0 and break
171
- i += 1
167
+ if i == 0 :
168
+ #This will be reset to 0 below
169
+ i = - 1
172
170
break
171
+ i -= 1
173
172
# Step 5: let entry be one earlier in the list.
174
173
entry = self .activeFormattingElements [i ]
175
174
You can’t perform that action at this time.
0 commit comments