def display_reaction(r, m_bold=None, direction=1):
    """
        Returns a string representation of a reaction and highlights the
        metabolite 'm' using HTML tags.
    """
    s_left = []
    s_right = []
    for m in r.reactants + r.products:
        if m == m_bold:
            s_met = "<a href='#%s'><b>%s</b></a>" % (m.id, m.id)
        else:
            s_met = "<a href='#%s'>%s</a>" % (m.id, m.id)
        
        coeff = r.get_coefficient(m)
        if abs(coeff) == 1:
            s_coeff = ""
        else:
            s_coeff = "%g " % abs(coeff)
        
        if coeff < 0:
            s_left += [s_coeff + s_met]
        else:
            s_right += [s_coeff + s_met]
    
    if direction == 1:
        return ' + '.join(s_left) + ' &#8651; ' + ' + '.join(s_right)
    else:
        return ' + '.join(s_right) + ' &#8651; ' + ' + '.join(s_left)