[Zope-Checkins] CVS: Zope/lib/python/TAL - HTMLTALParser.py:1.36

Fred L. Drake, Jr. fred@zope.com
Fri, 25 Apr 2003 14:07:27 -0400


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

Modified Files:
	HTMLTALParser.py 
Log Message:
Raise TALError when tal:content is used on an HTML tag that must be empty.

=== Zope/lib/python/TAL/HTMLTALParser.py 1.35 => 1.36 ===
--- Zope/lib/python/TAL/HTMLTALParser.py:1.35	Wed Sep 18 11:12:48 2002
+++ Zope/lib/python/TAL/HTMLTALParser.py	Fri Apr 25 14:06:56 2003
@@ -142,6 +142,10 @@
         self.scan_xmlns(attrs)
         tag, attrlist, taldict, metaldict, i18ndict \
              = self.process_ns(tag, attrs)
+        if tag in EMPTY_HTML_TAGS and taldict.get("content"):
+            raise TALError(
+                "empty HTML tags cannot use tal:content: %s" % `tag`,
+                self.getpos())
         self.tagstack.append(tag)
         self.gen.emitStartElement(tag, attrlist, taldict, metaldict, i18ndict,
                                   self.getpos())
@@ -154,6 +158,10 @@
         tag, attrlist, taldict, metaldict, i18ndict \
              = self.process_ns(tag, attrs)
         if taldict.get("content"):
+            if tag in EMPTY_HTML_TAGS:
+                raise TALError(
+                    "empty HTML tags cannot use tal:content: %s" % `tag`,
+                    self.getpos())
             self.gen.emitStartElement(tag, attrlist, taldict, metaldict,
                                       i18ndict, self.getpos())
             self.gen.emitEndElement(tag, implied=-1)