Rearrange HTML escaping