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

Commit4751ac4

Browse files
committed
Fix </p> handling
1 parent37b0fcc commit4751ac4

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

‎src/html5lib/html5parser.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ def processCharacters(self, token):
953953
# do it for space characters.
954954
self.tree.reconstructActiveFormattingElements()
955955
self.tree.insertText(token["data"])
956-
self.framesetOK=False
956+
self.parser.framesetOK=False
957957

958958
#This matches the current spec but may not match the real world
959959
defprocessSpaceCharacters(self,token):
@@ -1262,16 +1262,17 @@ def startTagOther(self, token):
12621262
self.tree.insertElement(token)
12631263

12641264
defendTagP(self,token):
1265-
ifself.tree.elementInScope("p"):
1266-
self.tree.generateImpliedEndTags("p")
1267-
ifself.tree.openElements[-1].name!="p":
1265+
ifnotself.tree.elementInScope("p"):
1266+
self.startTagCloseP(impliedTagToken("p","StartTag"))
12681267
self.parser.parseError("unexpected-end-tag", {"name":"p"})
1269-
ifself.tree.elementInScope("p"):
1270-
whileself.tree.elementInScope("p"):
1271-
self.tree.openElements.pop()
1268+
self.endTagP(impliedTagToken("p","EndTag"))
12721269
else:
1273-
self.startTagCloseP(impliedTagToken("p","StartTag"))
1274-
self.endTagP(impliedTagToken("p"))
1270+
self.tree.generateImpliedEndTags("p")
1271+
ifself.tree.openElements[-1].name!="p":
1272+
self.parser.parseError("unexpected-end-tag", {"name":"p"})
1273+
node=self.tree.openElements.pop()
1274+
whilenode.name!="p":
1275+
node=self.tree.openElements.pop()
12751276

12761277
defendTagBody(self,token):
12771278
# XXX Need to take open <p> tags into account here. We shouldn't imply

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp