[Zpt] CVS: Packages/TAL - nsgmllib.py:1.4

fred@digiciool.com fred@digiciool.com
Wed, 14 Mar 2001 12:45:48 -0500 (EST)


Update of /cvs-repository/Packages/TAL
In directory korak:/tmp/cvs-serv11784

Modified Files:
	nsgmllib.py 
Log Message:

Remove the support for empty start tags and end tags; these are never
used with HTML.



--- Updated File nsgmllib.py in package Packages/TAL --
--- nsgmllib.py	2001/03/14 16:11:14	1.3
+++ nsgmllib.py	2001/03/14 17:45:48	1.4
@@ -24,12 +24,12 @@
 entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]')
 charref = re.compile('&#([0-9]+)[^0-9]')
 
-starttagopen = re.compile('<[>a-zA-Z]')
+starttagopen = re.compile('<[a-zA-Z]')
 shorttagopen = re.compile('<[a-zA-Z][-.a-zA-Z0-9]*/')
 shorttag = re.compile('<([a-zA-Z][-.a-zA-Z0-9]*)/([^/]*)/')
 piopen = re.compile('<\?')
 piclose = re.compile('>')
-endtagopen = re.compile('</[<>a-zA-Z]')
+endtagopen = re.compile('</[a-zA-Z]')
 endbracket = re.compile('[<>]')
 special = re.compile('<![^<>]*>')
 commentopen = re.compile('<!--')
@@ -239,17 +239,12 @@
         j = match.start(0)
         # Now parse the data between i+1 and j into a tag and attrs
         attrs = []
-        if rawdata[i:i+2] == '<>':
-            # SGML shorthand: <> == <last open tag seen>
-            k = j
-            tag = self.lasttag
-        else:
-            match = tagfind.match(rawdata, i+1)
-            if not match:
-                raise RuntimeError, 'unexpected call to parse_starttag'
-            k = match.end(0)
-            tag = string.lower(rawdata[i+1:k])
-            self.lasttag = tag
+        match = tagfind.match(rawdata, i+1)
+        if not match:
+            raise RuntimeError, 'unexpected call to parse_starttag'
+        k = match.end(0)
+        tag = string.lower(rawdata[i+1:k])
+        self.lasttag = tag
         while k < j:
             match = attrfind.match(rawdata, k)
             if not match: break