def do_sub(self, match):
        cdict = match.groupdict()
        if cdict['htmlchars']:
            return cgi.escape(cdict['htmlchars'])
        if cdict['lineend']:
            return '<br>'
        elif cdict['space'] == '\t':
            return ' ' * self.tabstop
        elif cdict['space']:
            text = match.group().replace('\t', '&nbsp;' * self.tabstop)
            text = text.replace(' ', '&nbsp;')
            return text
Backward propagation of errors through recurrent layer.
dataset/ETHPy150Open evennia/evennia/evennia/utils/text2html.py/TextToHTMLparser.do_sub--crossover with--dataset/ETHPy150Open NervanaSystems/neon/neon/layers/recurrent.py/Recurrent.bprop