8000 Some minor documentation changes · awesome-python/html5lib-python@4454285 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4454285

Browse files
committed
Some minor documentation changes
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401011
1 parent ed1c27f commit 4454285

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/html5lib/html5parser.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ def __init__(self, strict = False, tree=simpletree.TreeBuilder,
3636
tree - a treebuilder class controlling the type of tree that will be
3737
returned. Built in treebuilders can be accessed through
3838
html5lib.treebuilders.getTreeBuilder(treeType)
39+
40+
tokenizer - a class that provides a stream of tokens to the treebuilder.
41+
This may be replaced for e.g. a sanitizer which converts some tags to
42+
text
3943
"""
4044

4145
# Raise an exception on the first error encountered
@@ -521,7 +525,7 @@ def appendToHead(self, element):
521525

522526
# the real thing
523527
def processEOF(self):
524-
if self.tree.openElements[-1].name in ("title", "style", "script"):
528+
if self.tree.openElements[-1].name in ("title", "style", "script", "noscript"):
525529
self.parser.parseError("expected-named-closing-tag-but-got-eof",
526530
{"name": self.tree.openElements[-1].name})
527531
self.tree.openElements.pop()
@@ -565,6 +569,7 @@ def startTagNoScript(self, name, attributes):
565569
self.tree.openElements[-1].appendChild(element)
566570
self.tree.openElements.append(element)
567571
self.parser.tokenizer.contentModelFlag = contentModelFlags["CDATA"]
572+
568573

569574
def startTagScript(self, name, attributes):
570575
#XXX Inner HTML case may be wrong

0 commit comments

Comments
 (0)
0