[Zope-Checkins] CVS: Zope/lib/python/StructuredText - HTMLClass.py:1.19
Andreas Jung
andreas@digicool.com
Tue, 5 Mar 2002 10:24:40 -0500
Update of /cvs-repository/Zope/lib/python/StructuredText
In directory cvs.zope.org:/tmp/cvs-serv15953
Modified Files:
HTMLClass.py
Log Message:
- <li> no longer uses <p> tags to enclose text
- minor code cleanup (striping of unused spaces)
=== Zope/lib/python/StructuredText/HTMLClass.py 1.18 => 1.19 ===
##############################################################################
-from string import join, split, find
from cgi import escape
import re, sys, ST
@@ -49,10 +48,10 @@
r=[]
self.header = header
self.dispatch(doc, level-1, r.append)
- return join(r,'')
+ return ''.join(r)
def _text(self, doc, level, output):
- output((doc.getNodeValue()))
+ output(doc.getNodeValue().strip())
def document(self, doc, level, output):
children=doc.getChildNodes()
@@ -109,11 +108,11 @@
p=doc.getPreviousSibling()
if p is None or p.getNodeName() is not doc.getNodeName():
output('\n<ul>\n')
- output('<li><p>')
+ output('<li>')
for c in doc.getChildNodes():
getattr(self, self.element_types[c.getNodeName()])(c, level, output)
n=doc.getNextSibling()
- output('</p></li>\n')
+ output('</li>\n')
if n is None or n.getNodeName() is not doc.getNodeName():
output('\n</ul>\n')
@@ -121,11 +120,11 @@
p=doc.getPreviousSibling()
if p is None or p.getNodeName() is not doc.getNodeName():
output('\n<ol>\n')
- output('<li><p>')
+ output('<li>')
for c in doc.getChildNodes():
getattr(self, self.element_types[c.getNodeName()])(c, level, output)
n=doc.getNextSibling()
- output('</p></li>\n')
+ output('</li>\n')
if n is None or n.getNodeName() is not doc.getNodeName():
output('\n</ol>\n')
@@ -235,8 +234,3 @@
output("</td>\n")
output("</tr>\n")
output("</table>\n")
-
-
-
-
-