Update 2018-06-26: This relates to the current version of Confluence in 2011. Please stop answering this question in relation to new versions (2017+)
---
When I paste code in Confluence 4, whether in a code block, preformatted text, or anywhere else, the whitespace is mangled and I need to correct it by hand.
Is there a way to correctly paste code so that my whitespace is preserved? Leading whitespace and empty lines in particular are causing the problem.