[Zope-CVS] CVS: Packages/HTMLStructure - Wrapper.py:1.4
Evan Simpson
evan@zope.com
Fri, 1 Feb 2002 15:46:41 -0500
Update of /cvs-repository/Packages/HTMLStructure
In directory cvs.zope.org:/tmp/cvs-serv15884
Modified Files:
Wrapper.py
Log Message:
Remove quotes from attribute values.
=== Packages/HTMLStructure/Wrapper.py 1.3 => 1.4 ===
def _attrs(self):
+ # Ensure that we have an open tag with attributes
sub = self.tag[3][0]
if sub[0] != 'open' or len(sub[3]) < 2 or sub[3][1][0] != 'attrs':
return ()
@@ -79,7 +80,12 @@
name = get_text(attr[3][0])
value = None
if len(attr[3]) == 2:
- value = get_text(attr[3][1])
+ valuedata = attr[3][1]
+ value = get_text(valuedata)
+ # if there are quotes, strip them
+ quote = valuedata[3][0]
+ if quote[1] < quote[2]:
+ value = value[1:-1]
attrs.append((name, value))
return attrs