Nevermind. It turns out the "Markdown" block fixes all the problems. I put my code into Markdown and it worked brilliantly.
Rather than delete I'm leaving this up so that if some poor soul googles this problem later and stumbles across this, perhaps they will be helped too.