Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53bf191

Browse files
committed
Slight fixes to active formatting elements
1 parentd05574a commit53bf191

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

‎src/html5lib/treebuilders/_base.py‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,22 @@ def reconstructActiveFormattingElements(self):
166166

167167
# Step 6
168168
whileentry!=Markerandentrynotinself.openElements:
169-
# Step 5: let entry be one earlier in the list.
170169
i-=1
171-
try:
172-
entry=self.activeFormattingElements[i]
173-
except:
174-
# Step 4: at this point we need to jump to step 8. By not doing
175-
# i += 1 which is also done in step 7 we achieve that.
170+
ifi<0:
171+
# Step 4: at this point we need to jump to step 8.
172+
# So we reset the index to 0 and break
173+
i+=1
176174
break
175+
# Step 5: let entry be one earlier in the list.
176+
entry=self.activeFormattingElements[i]
177+
177178
whileTrue:
178179
# Step 7
179180
i+=1
180181

181182
# Step 8
182-
clone=self.activeFormattingElements[i].cloneNode()
183+
entry=self.activeFormattingElements[i]
184+
clone=entry.cloneNode()#Mainly to get a new copy of the attributes
183185

184186
# Step 9
185187
element=self.insertElement({"type":"StartTag",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp