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

Commit3da1fdc

Browse files
committed
compatMode wasn't reinitialized between several uses of the same parser. Also changed compatMode values ("no-quirks" to "no quirks" and "limited-quirks" to "limited quirks")
--HG--extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401122
1 parente7db409 commit3da1fdc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/html5lib/html5parser.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, strict = False, tree=simpletree.TreeBuilder,
5454
self.errors= []
5555

5656
# "quirks" / "limited-quirks" / "no-quirks"
57-
self.compatMode="no-quirks"
57+
self.compatMode="noquirks"
5858

5959
self.phases= {
6060
"initial":InitialPhase(self,self.tree),
@@ -87,6 +87,7 @@ def _parse(self, stream, innerHTML=False, container="div",
8787
self.tree.reset()
8888
self.firstStartTag=False
8989
self.errors= []
90+
self.compatMode="no quirks"
9091

9192
self.tokenizer=self.tokenizer_class(stream,encoding=encoding,
9293
parseMeta=parseMeta,
@@ -324,7 +325,7 @@ def processDoctype(self, name, publicId, systemId, correct):
324325
ifpublicId!="":
325326
publicId=publicId.translate(asciiUpper2Lower)
326327

327-
ifnotcorrectornameLower!="html"\
328+
if(notcorrect)ornameLower!="html"\
328329
orpublicIdin\
329330
("+//silmaril//dtd html pro v0r11 19970101//en",
330331
"-//advasoft ltd//dtd html 3.0 aswedit + extensions//en",
@@ -399,15 +400,15 @@ def processDoctype(self, name, publicId, systemId, correct):
399400
("-//w3c//dtd html 4.01 frameset//EN",
400401
"-//w3c//dtd html 4.01 transitional//EN")andsystemId==None)\
401402
or (systemId!=Noneand\
402-
systemId=="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"):
403+
systemId=="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"):
403404
self.compatMode="quirks"
404405
elifpublicIdin\
405406
("-//w3c//dtd xhtml 1.0 frameset//EN",
406407
"-//w3c//dtd xhtml 1.0 transitional//EN")\
407408
or (publicIdin\
408409
("-//w3c//dtd html 4.01 frameset//EN",
409410
"-//w3c//dtd html 4.01 transitional//EN")andsystemId==None):
410-
self.compatMode="limited-quirks"
411+
self.compatMode="limitedquirks"
411412

412413
self.parser.phase=self.parser.phases["beforeHtml"]
413414

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp