[Zope3-checkins] CVS: Zope3/src/zope/tal - htmltalparser.py:1.3

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


Update of /cvs-repository/Zope3/src/zope/tal
In directory cvs.zope.org:/tmp/cvs-serv10910/src/zope/tal

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

=== Zope3/src/zope/tal/htmltalparser.py 1.2 => 1.3 ===
--- Zope3/src/zope/tal/htmltalparser.py:1.2	Wed Dec 25 09:15:29 2002
+++ Zope3/src/zope/tal/htmltalparser.py	Fri Apr 25 14:07:21 2003
@@ -144,6 +144,10 @@
         self.scan_xmlns(attrs)
         tag, attrlist, taldict, metaldict, i18ndict \
              = self.process_ns(tag, attrs)
+        if tag in EMPTY_HTML_TAGS and "content" in taldict:
+            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())
@@ -156,6 +160,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)