[ZPT] CVS: Zope/lib/python/TAL/tests - test_htmltalparser.py:1.27
Fred L. Drake, Jr.
fdrake@acm.org
Fri, 10 May 2002 17:15:55 -0400
Update of /cvs-repository/Zope/lib/python/TAL/tests
In directory cvs.zope.org:/tmp/cvs-serv27343/tests
Modified Files:
test_htmltalparser.py
Log Message:
Add a comment explaining why the new test is wrong.
=== Zope/lib/python/TAL/tests/test_htmltalparser.py 1.26 => 1.27 ===
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),