X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e42c7b856732d0f7c3a209a42c269c613d40578a..ddfc587a2ea899f654d940c21f102316a39985bd:/wxPython/samples/stxview/StructuredText/HTMLClass.py diff --git a/wxPython/samples/stxview/StructuredText/HTMLClass.py b/wxPython/samples/stxview/StructuredText/HTMLClass.py index d5c03d8357..951aec4c97 100644 --- a/wxPython/samples/stxview/StructuredText/HTMLClass.py +++ b/wxPython/samples/stxview/StructuredText/HTMLClass.py @@ -84,6 +84,7 @@ ############################################################################## from string import join, split, find +from cgi import escape import re, sys, ST class HTMLClass: @@ -172,34 +173,34 @@ class HTMLClass: def bullet(self, doc, level, output): p=doc.getPreviousSibling() if p is None or p.getNodeName() is not doc.getNodeName(): - output('
') - output(html_quote(c.getNodeValue())) - output('\n') + output('\n
\n') + output(escape(c.getNodeValue())) + output('\n\n') else: getattr(self, self.element_types[c.getNodeName()])( c, level, output) @@ -214,7 +215,7 @@ class HTMLClass: else: getattr(self, self.element_types[c.getNodeName()])( c, level, output) - output('') + output('\n') def link(self, doc, level, output): output('' % doc.href) @@ -231,7 +232,7 @@ class HTMLClass: def literal(self, doc, level, output): output('
')
for c in doc.getChildNodes():
- output(html_quote(c.getNodeValue()))
+ output(escape(c.getNodeValue()))
output('
')
def strong(self, doc, level, output):
@@ -267,6 +268,10 @@ class HTMLClass:
def sgml(self,doc,level,output):
for c in doc.getChildNodes():
getattr(self, self.element_types[c.getNodeName()])(c, level, output)
+
+ def xref(self, doc, level, output):
+ val = doc.getNodeValue()
+ output('[%s]' % (val, val) )
def table(self,doc,level,output):
"""
@@ -279,29 +284,23 @@ class HTMLClass:
for row in doc.getRows()[0]:
output("