', + 'foo = "";', + 'foo = "";', + 'foo = <\n/script> ', + '', + ('\n//<\\/s\'+\'cript>\');\n//]]>'), + 'foo = "";', + u'', + # these two should be invalid according to the HTML 5 spec, + # section 8.1.2.2 + #'foo = \nscript>', + #'foo = script>', + ] + for content in contents: + for element in elements: + element_lower = element.lower() + s = u'<{element}>{content}{element}>'.format(element=element, + content=content) + self._run_check(s, [("starttag", element_lower, []), + ("data", content), + ("endtag", element_lower)]) + def test_entityrefs_in_attributes(self): self._run_check("", [