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.get_reactants() + r.get_products()):
        if m == m_bold:
            s_met = f"<a href='#{m.id}'><b>{m.id}</b></a>"
        else:
            s_met = f"<a href='#{m.id}'>{m.id}</a>"
        coeff = r.get_coefficient(m)
        if abs(coeff) == 1:
            s_coeff = ''
        else:
            s_coeff = f'{abs(coeff):g} '
        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)
