'Here we can modify the text, before it\'s parsed.'

def preprocess_string(self, html_string):

    if (not html_string):
        return html_string
    html_string = html_string.replace(u'    \xbb', u'')
    html_string = html_string.replace(u'&ndash;', u'-')
    try:
        preprocessors = self.preprocessors
    except AttributeError:
        return html_string
    for (src, sub) in preprocessors:
        if callable(getattr(src, 'sub', None)):
            html_string = src.sub(sub, html_string)
        elif isinstance(src, str):
            html_string = html_string.replace(src, sub)
        elif callable(src):
            try:
                html_string = src(html_string)
            except Exception as e:
                _msg = '%s:    caught    exception    preprocessing    html'
                self._logger.error(_msg, self._cname, exc_info=True)
                continue
    return html_string
