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

Commit81c4a5d

Browse files
author
James Graham
committed
Fix handling of \ufffd before framesets
1 parent6d29b33 commit81c4a5d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎html5lib/html5parser.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def startswithany(str, prefixes):
4343
fromconstantsimportscopingElements,formattingElements,specialElements
4444
fromconstantsimportheadingElements,tableInsertModeElements
4545
fromconstantsimportcdataElements,rcdataElements,voidElements
46-
fromconstantsimporttokenTypes,ReparseException,namespaces
46+
fromconstantsimporttokenTypes,ReparseException,namespaces,spaceCharacters
4747

4848
defparse(doc,treebuilder="simpletree",encoding=None,
4949
namespaceHTMLElements=True):
@@ -977,7 +977,11 @@ def processSpaceCharactersDropNewline(self, token):
977977
defprocessCharacters(self,token):
978978
self.tree.reconstructActiveFormattingElements()
979979
self.tree.insertText(token["data"])
980-
self.parser.framesetOK=False
980+
#This must be bad for performance
981+
if (self.parser.framesetOKand
982+
any([charnotinset(u"\ufffd")|spaceCharacters
983+
forcharintoken["data"]])):
984+
self.parser.framesetOK=False
981985

982986
defprocessSpaceCharacters(self,token):
983987
self.tree.reconstructActiveFormattingElements()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp