|
1 | 1 | from __future__importabsolute_import,division,unicode_literals |
2 | 2 | fromsiximportwith_metaclass |
3 | 3 |
|
4 | | -importsys |
5 | 4 | importtypes |
6 | 5 |
|
7 | 6 | from .importinputstream |
|
14 | 13 | from .importutils |
15 | 14 | from .importconstants |
16 | 15 | from .constantsimportspaceCharacters,asciiUpper2Lower |
17 | | -from .constantsimportformattingElements,specialElements |
18 | | -from .constantsimportheadingElements,tableInsertModeElements |
19 | | -from .constantsimportcdataElements,rcdataElements,voidElements |
20 | | -from .constantsimporttokenTypes,ReparseException,namespaces,spaceCharacters |
| 16 | +from .constantsimportspecialElements |
| 17 | +from .constantsimportheadingElements |
| 18 | +from .constantsimportcdataElements,rcdataElements |
| 19 | +from .constantsimporttokenTypes,ReparseException,namespaces |
21 | 20 | from .constantsimporthtmlIntegrationPointElements,mathmlTextIntegrationPointElements |
22 | 21 |
|
23 | 22 | defparse(doc,treebuilder="simpletree",encoding=None, |
@@ -88,7 +87,7 @@ def _parse(self, stream, innerHTML=False, container="div", |
88 | 87 | try: |
89 | 88 | self.mainLoop() |
90 | 89 | break |
91 | | -exceptReparseExceptionase: |
| 90 | +exceptReparseException: |
92 | 91 | self.reset() |
93 | 92 |
|
94 | 93 | defreset(self): |
@@ -405,7 +404,7 @@ def parseRCDataRawtext(self, token, contentType): |
405 | 404 | """ |
406 | 405 | assertcontentTypein ("RAWTEXT","RCDATA") |
407 | 406 |
|
408 | | -element=self.tree.insertElement(token) |
| 407 | +self.tree.insertElement(token) |
409 | 408 |
|
410 | 409 | ifcontentType=="RAWTEXT": |
411 | 410 | self.tokenizer.state=self.tokenizer.rawtextState |
@@ -1402,7 +1401,6 @@ def endTagFormatting(self, token): |
1402 | 1401 | """The much-feared adoption agency algorithm""" |
1403 | 1402 | # http://www.whatwg.org/specs/web-apps/current-work/#adoptionAgency |
1404 | 1403 | # XXX Better parseError messages appreciated. |
1405 | | -name=token["name"] |
1406 | 1404 |
|
1407 | 1405 | # Step 1 |
1408 | 1406 | outerLoopCounter=0 |
@@ -1620,7 +1618,7 @@ def endTagScript(self, token): |
1620 | 1618 | #document.write works |
1621 | 1619 |
|
1622 | 1620 | defendTagOther(self,token): |
1623 | | -node=self.tree.openElements.pop() |
| 1621 | +self.tree.openElements.pop() |
1624 | 1622 | self.parser.phase=self.parser.originalPhase |
1625 | 1623 |
|
1626 | 1624 | classInTablePhase(Phase): |
|