From 344229e3a9962d77a3bc65103a66289eb44ce3c2 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Fri, 17 Jun 2011 02:11:34 +0200 Subject: [PATCH] appy.pod: bugfix for https://bugs.launchpad.net/appy/+bug/778728 (function 'text'). --- pod/renderer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pod/renderer.py b/pod/renderer.py index 7dee302..bbc36e9 100644 --- a/pod/renderer.py +++ b/pod/renderer.py @@ -21,7 +21,7 @@ import zipfile, shutil, xml.sax, os, os.path, re, mimetypes, time from UserDict import UserDict -import appy.pod, time +import appy.pod, time, cgi from appy.pod import PodError from appy.shared import mimeTypesExts from appy.shared.xml_parser import XmlElement @@ -240,7 +240,7 @@ class Renderer: def renderText(self, text, encoding='utf-8', stylesMapping={}): '''Method that can be used (under the name 'text') into a pod template for inserting a text containing carriage returns.''' - text = text.replace('\r\n', '
').replace('\n', '
') + text = cgi.escape(text).replace('\r\n', '
').replace('\n', '
') return self.renderXhtml(text, encoding, stylesMapping) def evalIfExpression(self, condition, ifTrue, ifFalse):