[Zope3-checkins] CVS: Zope3/src/zope/app/onlinehelp - __init__.py:1.9

Roger Ineichen roger@projekt01.ch
Tue, 24 Jun 2003 10:58:15 -0400


Update of /cvs-repository/Zope3/src/zope/app/onlinehelp
In directory cvs.zope.org:/tmp/cvs-serv14379

Modified Files:
	__init__.py 
Log Message:
Added  temporary text formating rules for showing text files in the more correct way.

=== Zope3/src/zope/app/onlinehelp/__init__.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/onlinehelp/__init__.py:1.8	Fri Jun 13 13:41:18 2003
+++ Zope3/src/zope/app/onlinehelp/__init__.py	Tue Jun 24 10:58:14 2003
@@ -60,7 +60,13 @@
         raw = open(self._content_path).read()
 
         if self._doc_type == 'txt':
-            return '<p>' + raw.replace('\n\n', '\n</p><p>') + '</p>'
+            # XXX This should be cleaned up when reST is implemented
+            raw = raw.replace('<', '&lt;')
+            raw = raw.replace('>', '&gt;')
+            raw = '<p>' + raw.replace('\n\n', '\n</p><p>') + '</p>'
+            raw = raw.replace('\n', '<br>')
+            raw = raw.replace('  ', '&nbsp;&nbsp;')
+            return raw
         else:
             return raw