def _2xpre(s, styles):
    """Helper to transform Pygments HTML output to ReportLab markup"""
    s = s.replace('<div class="highlight">', '')
    s = s.replace('</div>', '')
    s = s.replace('<pre>', '')
    s = s.replace('</pre>', '')
    for k, c in (styles + [('p', '#000000'), ('n', '#000000'), ('err',
        '#000000')]):
        s = s.replace('<span class="%s">' % k, '<span color="%s">' % c)
    return s
