Skip to content

Commit 9508692

Browse files
committed
Shortcut the entire meta encoding pre-parse when possible
1 parent aa0666e commit 9508692

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

html5lib/_inputstream.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,9 @@ def __init__(self, data):
682682
self.encoding = None
683683

684684
def getEncoding(self):
685+
if b"<meta" not in self.data:
686+
return None
687+
685688
methodDispatch = (
686689
(b"<!--", self.handleComment),
687690
(b"<meta", self.handleMeta),

0 commit comments

Comments
 (0)