"""
-# helper function
+# helper functions
def rst_to_html(rst):
settings = {
'input_encoding': encoding,
writer_name = "html")
return parts['body'].encode('utf8')
+def sanitize(obj):
+ if isinstance(obj, basestring):
+ return cgi.escape(obj, True)
+ return obj
+
+
# find out our URL, needed for syndication
try:
n = os.environ['SERVER_NAME']
def to_vars(self):
return {
- 'arttitle': self.title,
- 'author': self.author,
+ 'arttitle': sanitize(self.title),
+ 'author': sanitize(self.author),
'date': self.created.isoformat(' '),
'uuid': self.uuid,
'tags': self.get_tags_links(),
tags.sort()
for t in tags:
l.append('<a class="tag" href="%s/tag/%s">%s</a>' % \
- (blog_url, urllib.quote(t), t) )
+ (blog_url, urllib.quote(t), sanitize(t) ))
return ', '.join(l)