Commit cd292de0 authored by Fred Drake's avatar Fred Drake

Added a test case to make sure <script> and <style> elements are handled

correctly.
parent 930e0415
...@@ -241,6 +241,20 @@ text ...@@ -241,6 +241,20 @@ text
("starttag", "foo:bar", [("one", "1"), ("two", "2")]), ("starttag", "foo:bar", [("one", "1"), ("two", "2")]),
("starttag_text", s)]) ("starttag_text", s)])
def check_cdata_content(self):
s = """<script> <!-- not a comment --> &not-an-entity-ref; </script>"""
self._run_check(s, [
("starttag", "script", []),
("data", " <!-- not a comment --> &not-an-entity-ref; "),
("endtag", "script"),
])
s = """<script> <not a='start tag'> </script>"""
self._run_check(s, [
("starttag", "script", []),
("data", " <not a='start tag'> "),
("endtag", "script"),
])
# Support for the Zope regression test framework: # Support for the Zope regression test framework:
def test_suite(): def test_suite():
......
...@@ -241,6 +241,20 @@ text ...@@ -241,6 +241,20 @@ text
("starttag", "foo:bar", [("one", "1"), ("two", "2")]), ("starttag", "foo:bar", [("one", "1"), ("two", "2")]),
("starttag_text", s)]) ("starttag_text", s)])
def check_cdata_content(self):
s = """<script> <!-- not a comment --> &not-an-entity-ref; </script>"""
self._run_check(s, [
("starttag", "script", []),
("data", " <!-- not a comment --> &not-an-entity-ref; "),
("endtag", "script"),
])
s = """<script> <not a='start tag'> </script>"""
self._run_check(s, [
("starttag", "script", []),
("data", " <not a='start tag'> "),
("endtag", "script"),
])
# Support for the Zope regression test framework: # Support for the Zope regression test framework:
def test_suite(): def test_suite():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment