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

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Aug 20 17:16:49 EDT 2003


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

Modified Files:
      Tag: srichter-inlinepython-branch
	htmltalparser.py 
Log Message:
Thanks to fdrake for the pointer, we now have even <script lang=""></script>
support.


=== Zope3/src/zope/tal/htmltalparser.py 1.4 => 1.4.34.1 ===
--- Zope3/src/zope/tal/htmltalparser.py:1.4	Thu May  1 15:35:49 2003
+++ Zope3/src/zope/tal/htmltalparser.py	Wed Aug 20 16:16:17 2003
@@ -146,6 +146,13 @@
             raise TALError(
                 "empty HTML tags cannot use tal:content: %s" % `tag`,
                 self.getpos())
+        print tag, attrlist, taldict, metaldict, i18ndict
+        # Support for inline Python code.
+        if tag == 'script':
+            lang_attr = filter(lambda a: a[0] == 'lang', attrlist)
+            if lang_attr:
+                attrlist.remove(lang_attr[0])
+                taldict = {'script': lang_attr[0][1], 'omit-tag': ''}
         self.tagstack.append(tag)
         self.gen.emitStartElement(tag, attrlist, taldict, metaldict, i18ndict,
                                   self.getpos())




More information about the Zope3-Checkins mailing list