This question already has an answer here:
I answered a question in StackOverflow. Soon after, I added code to the answer. After a few more edits, I copied some of the code and pasted it at the end, made some modifications, and it's part of the same block of code. However, when StackOverflow formats it, the code is not formatted as code.
The text in the actual answer which I edited is formatted perfectly, four spaces in front of every line. However, it's formatted as plain text instead.
This happened in my answer to this question: