',
@@ -278,44 +284,83 @@ def test_cdata_content(self):
'src="http://www.example.org/r=\'+new '
'Date().getTime()+\'"><\\/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_cdata_with_closing_tags(self):
+ 'foo = " script>"',
+ 'foo = ""',
+ 'foo = ""',
+ 'foo = ""',
+ 'foo = "ſcript>"',
+ 'foo = ""',
+ ])
+ def test_script_content(self, content):
+ s = f''
+ self._run_check(s, [("starttag", "script", []),
+ ("data", content),
+ ("endtag", "script")])
+
+ @support.subTests('content', [
+ 'a::before { content: ""; }',
+ 'a::before { content: "¬-an-entity-ref;"; }',
+ 'a::before { content: "
''""" - for element in [' script', 'script ', ' script ', - '\nscript', 'script\n', '\nscript\n']: - element_lower = element.lower().strip() - s = '', True), + ]) + def test_eof_in_script(self, tail, end): + content = "a = 123" + s = f'"/>``. + +* Multiple slashes and whitespaces between the last attribute and closing ``>`` + are now ignored in both start and end tags. E.g. ````. + +* Multiple ``=`` between attribute name and value are no longer collapsed. + E.g. ```` produces attribute "foo" with value "=bar". + +* Whitespaces between the ``=`` separator and attribute name or value are no + longer ignored. E.g. ```` produces two attributes "foo" and + "=bar", both with value None; ```` produces two attributes: + "foo" with value "" and "bar" with value None.