From 0a4acbc2f9b8e0d441d46d6d8d5463d1994e8286 Mon Sep 17 00:00:00 2001 From: Rolux Date: Thu, 8 May 2008 09:02:51 +0200 Subject: [PATCH] fixing decodeHtml --- oxutils/html.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/oxutils/html.py b/oxutils/html.py index 7f2a380..6de8423 100644 --- a/oxutils/html.py +++ b/oxutils/html.py @@ -138,9 +138,9 @@ def decodeHtml(html): >>> decodeHtml('me & you and $&%') u'me & you and $&%' """ - if type(text) != unicode: - text = unicode(text)[:] - if type(text) is unicode: + if type(html) != unicode: + html = unicode(html)[:] + if type(html) is unicode: uchr = unichr else: uchr = lambda value: value > 255 and unichr(value) or chr(value) @@ -154,7 +154,7 @@ def decodeHtml(html): return uchr(name2codepoint[entity]) else: return match.group(0) - return charrefpat.sub(entitydecode, text).replace(u'\xa0', ' ') + return charrefpat.sub(entitydecode, html).replace(u'\xa0', ' ') def highlight(text, query, hlClass="hl"): """