@@ -43,7 +43,7 @@ def startswithany(str, prefixes):
43
43
from constants import scopingElements , formattingElements , specialElements
44
44
from constants import headingElements , tableInsertModeElements
45
45
from constants import cdataElements , rcdataElements , voidElements
46
- from constants import tokenTypes , ReparseException , namespaces
46
+ from constants import tokenTypes , ReparseException , namespaces , spaceCharacters
47
47
48
48
def parse (doc , treebuilder = "simpletree" , encoding = None ,
49
49
namespaceHTMLElements = True ):
@@ -977,7 +977,11 @@ def processSpaceCharactersDropNewline(self, token):
977
977
def processCharacters (self , token ):
978
978
self .tree .reconstructActiveFormattingElements ()
979
979
self .tree .insertText (token ["data" ])
980
- self .parser .framesetOK = False
980
+ #This must be bad for performance
981
+ if (self .parser .framesetOK and
982
+ any ([char not in set (u"\ufffd " ) | spaceCharacters
983
+ for char in token ["data" ]])):
984
+ self .parser .framesetOK = False
981
985
982
986
def processSpaceCharacters (self , token ):
983
987
self .tree .reconstructActiveFormattingElements ()
0 commit comments