Only replace &amp; in pre block, that was what was causing the problem in any case