[ZPT] CVS: Zope/lib/python/TAL/tests - test_htmltalparser.py:1.25.32.2

Fred L. Drake, Jr. fdrake@acm.org
Fri, 10 May 2002 17:16:20 -0400


Update of /cvs-repository/Zope/lib/python/TAL/tests
In directory cvs.zope.org:/tmp/cvs-serv27464/tests

Modified Files:
      Tag: Zope-2_5-branch
	test_htmltalparser.py 
Log Message:
Add a comment explaining why the new test is wrong.

=== Zope/lib/python/TAL/tests/test_htmltalparser.py 1.25.32.1 => 1.25.32.2 ===
            HTML comment, and should be ignored.
         """
+        # The above comment is not generally true.  The HTML 4 specification
+        # gives <script> a CDATA content model, which means comments are not
+        # syntactically recognized (those characters contribute to the text
+        # content of the <script> element).  The '</a' in the '</a>' causes
+        # the SGML markup-in-context rules to kick in, and '</a>' should then
+        # be recognized as an improperly nested end tag.  See:
+        # http://www.w3.org/TR/html401/types.html#type-cdata
+        #
         s = """<script>\n<!--\ndocument.write("</a>");\n// -->\n</script>"""
         output = [
             rawtext(s),