Try to unbreak Django's HTML damage

When we paste, Django "helpfully" inserts &nbsp; characters which break
the format. We format some of the HTML here to try and avoid that, but
with limited success.