I have found the cause of the problem with source code formatting. Turns out that the whitespace filter in the latest versions of DNN do not respect the PRE tag and destroy formatted.
Expect to see mangled code lists to get their correct formatting back in the near future.