Skip to content

Commit 01b8c38

Browse files
author
Richard Jones
committed
*gak* ... xmp is Old Skool apparently.
Am using pre again by have the option on the plain() template function to escape the text for HTML.
1 parent 2e30a0a commit 01b8c38

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

roundup/htmltemplate.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: htmltemplate.py,v 1.23 2001-09-10 09:47:18 richard Exp $
18+
# $Id: htmltemplate.py,v 1.24 2001-09-27 06:45:58 richard Exp $
1919

2020
import os, re, StringIO, urllib, cgi, errno
2121

@@ -40,7 +40,7 @@ class Plain(Base):
4040
for a Link or Multilink property, display the key strings of the
4141
linked nodes (or the ids if the linked class has no key property)
4242
'''
43-
def __call__(self, property):
43+
def __call__(self, property, escape=0):
4444
if not self.nodeid and self.form is None:
4545
return '[Field: not called from item]'
4646
propclass = self.properties[property]
@@ -68,6 +68,8 @@ def __call__(self, property):
6868
value = ', '.join([linkcl.get(i, k) for i in value])
6969
else:
7070
s = 'Plain: bad propclass "%s"'%propclass
71+
if escape:
72+
return cgi.escape(value)
7173
return value
7274

7375
class Field(Base):
@@ -745,6 +747,11 @@ def newitem(client, templates, db, classname, form, replace=re.compile(
745747

746748
#
747749
# $Log: not supported by cvs2svn $
750+
# Revision 1.23 2001/09/10 09:47:18 richard
751+
# Fixed bug in the generation of links to Link/Multilink in indexes.
752+
# (thanks Hubert Hoegl)
753+
# Added AssignedTo to the "classic" schema's item page.
754+
#
748755
# Revision 1.22 2001/08/30 06:01:17 richard
749756
# Fixed missing import in mailgw :(
750757
#
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Id: msg.index,v 1.2 2001-09-27 06:36:42 richard Exp $-->
1+
<!-- $Id: msg.index,v 1.3 2001-09-27 06:45:58 richard Exp $-->
22
<tr class="row-hilite">
33
<property name="date">
44
<td><display call="link('date')"></td>
@@ -8,5 +8,5 @@
88
</property>
99
</tr>
1010
<tr bgcolor="ffeaff">
11-
<td colspan=2><xmp><display call="plain('content')"></xmp></td>
11+
<td colspan=2><pre><display call="plain('content', escape=1)"></pre></td>
1212
</tr>

roundup/templates/extended/htmlbase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
</property>
193193
</tr>
194194
<tr bgcolor="ffeaff">
195-
<td colspan=2><xmp><display call="plain('content')"></xmp></td>
195+
<td colspan=2><pre><display call="plain('content', escape=1)"></pre></td>
196196
</tr>
197197
"""
198198

0 commit comments

Comments
 (0)