[cpif] r200 - trunk/frontend-web
svn at argo.es
svn at argo.es
Fri Jun 29 20:56:17 CEST 2007
Author: alvaro
Date: Fri Jun 29 20:56:16 2007
New Revision: 200
Log:
Bugfix
Modified:
trunk/frontend-web/parsers.py
Modified: trunk/frontend-web/parsers.py
==============================================================================
--- trunk/frontend-web/parsers.py (original)
+++ trunk/frontend-web/parsers.py Fri Jun 29 20:56:16 2007
@@ -8,8 +8,9 @@
def convert_to_html(text):
from globales import allow_bbcode,allow_html
- if not allow_html and not allow_bbcode:
- return False, escape(text)
+ retval = False
+ if not allow_html or not allow_bbcode:
+ text = escape(text)
if allow_html:
parser = HTMLParser()
parser.reset()
@@ -19,16 +20,13 @@
if not text: raise SGMLParseError, "HTML no valido"
except SGMLParseError, e:
return e or "HTML no valido", None
- else:
- text = escape(text)
if allow_bbcode:
parser = BBCodeParser()
parser.feed(text)
- return parser.parse()
- else:
- return False, escape(text)
+ retval, text = parser.parse()
+ return retval, text
class TestHTMLParser(unittest.TestCase):
correct_html = (
More information about the cpif
mailing list