The new feature, GitHub (tilde) code blocks, from Implement ```-style (fenced) Markdown code blocks is a great addition, but there is a small bug which bizarrely only appears on Code Review & Code Review Meta. If a code block contains a blank line anywhere, and the closing
``` isn't followed by a newline, it will be taken as code rather than a closing fence.
The bug applies to both the previews of the posted content. It can be worked around easily enough by finishing the post with a newline but is unexpected. The source of the problem seems to be due to MathJax.
This can result in accidental noise in any code block at the end of a post:
some code more code but there was a blank line above ```
if not post.body.endswith('\n'): post.body += '\n'. Sure it's a monkey patch, but it's been a year... \$\endgroup\$