', + 'foo = "";', + 'foo = "";', + 'foo = <\n/script> ', + '', + ('\n//<\\/s\'+\'cript>\');\n//]]>'), + '\n\n', + 'foo = "";', + '', + # these two should be invalid according to the HTML 5 spec, + # section 8.1.2.2 + #'foo = \nscript>', + #'foo = script>', + ] + elements = ['script', 'style', 'SCRIPT', 'STYLE', 'Script', 'Style'] + for content in contents: + for element in elements: + element_lower = element.lower() + s = '<{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("", [ diff --git a/Misc/NEWS b/Misc/NEWS index 94f22fcf95f..133b8ba4b62 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -350,10 +350,13 @@ Core and Builtins Library ------- -- Issue 10817: Fix urlretrieve function to raise ContentTooShortError even +- Issue #670664: Fix HTMLParser to correctly handle the content of + ```` and ````. + +- Issue #10817: Fix urlretrieve function to raise ContentTooShortError even when reporthook is None. Patch by Jyrki Pulliainen. -- Issue 13296: Fix IDLE to clear compile __future__ flags on shell restart. +- Issue #13296: Fix IDLE to clear compile __future__ flags on shell restart. (Patch by Roger Serwy) - Fix the xmlrpc.client user agent to return something similar to