Skip to content

Commit 81c4a5d

Browse files
author
James Graham
committed
Fix handling of \ufffd before framesets
1 parent 6d29b33 commit 81c4a5d

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
from constants import scopingElements, formattingElements, specialElements
4444
from constants import headingElements, tableInsertModeElements
4545
from constants import cdataElements, rcdataElements, voidElements
46-
from constants import tokenTypes, ReparseException, namespaces
46+
from constants import tokenTypes, ReparseException, namespaces, spaceCharacters
4747

4848
def parse(doc, treebuilder="simpletree", encoding=None,
4949
namespaceHTMLElements=True):
@@ -977,7 +977,11 @@ def processSpaceCharactersDropNewline(self, token):
977977
def processCharacters(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.framesetOK and
982+
any([char not in set(u"\ufffd") | spaceCharacters
983+
for char in token["data"]])):
984+
self.parser.framesetOK = False
981985

982986
def processSpaceCharacters(self, token):
983987
self.tree.reconstructActiveFormattingElements()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy