Before this patch, the final line of code was ending up as </pre</pre> as not enough characters were getting stripped away before exploding into individual lines.