Fixed a regression introduced in rev eb2bd8d that made the webclient fail when loading text2html.

This commit is contained in:
Griatch 2015-10-01 01:18:17 +02:00
parent 873c46ed8c
commit d5f70b6524

View file

@ -211,17 +211,17 @@ class TextToHTMLparser(object):
text (str): Processed text.
"""
c = m.groupdict()
if c['htmlchars']:
return cgi.escape(c['htmlchars'])
if c['lineend']:
cdict = match.groupdict()
if cdict['htmlchars']:
return cgi.escape(cdict['htmlchars'])
if cdict['lineend']:
return '<br>'
elif c['space'] == '\t':
elif cdict['space'] == '\t':
return ' ' * self.tabstop
elif c['space']:
t = m.group().replace('\t', '&nbsp;' * self.tabstop)
t = t.replace(' ', '&nbsp;')
return t
elif cdict['space']:
text = match.group().replace('\t', '&nbsp;' * self.tabstop)
text = text.replace(' ', '&nbsp;')
return text
def parse(self, text, strip_ansi=False):
"""