@@ -36,6 +36,10 @@ def __init__(self, strict = False, tree=simpletree.TreeBuilder,
36
36
tree - a treebuilder class controlling the type of tree that will be
37
37
returned. Built in treebuilders can be accessed through
38
38
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
39
43
"""
40
44
41
45
# Raise an exception on the first error encountered
@@ -521,7 +525,7 @@ def appendToHead(self, element):
521
525
522
526
# the real thing
523
527
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" ):
525
529
self .parser .parseError ("expected-named-closing-tag-but-got-eof" ,
526
530
{"name" : self .tree .openElements [- 1 ].name })
527
531
self .tree .openElements .pop ()
@@ -565,6 +569,7 @@ def startTagNoScript(self, name, attributes):
565
569
self .tree .openElements [- 1 ].appendChild (element )
566
570
self .tree .openElements .append (element )
567
571
self .parser .tokenizer .contentModelFlag = contentModelFlags ["CDATA" ]
572
+
568
573
569
574
def startTagScript (self , name , attributes ):
570
575
#XXX Inner HTML case may be wrong
0 commit comments