I have noticed that posting code and keeping it formatted properly is difficult. The built in formatting is a bit obscure compared to normal forum posts and deals heavily with invisible characters.
I find that sometimes pasting code works and some times it doesn’t. The best way seems to be to write it out by hand directly into the site’s open window. It seems that the site auto generates some sort of special character or line feed when the user hits return. This seems to break when PASTING code, as the line feeds are included in the paste.
What is the best way to post and PASTE code?
it’s closed now but guys i just want to inform you that the shortcut for making your text code is ctrl+k after highlighting your code part .
I don't trust the direct auto-formatting of pasted code either; I find it tends to break if I need to add something to it while it's in the textbox, or when I continue the post after the pasted snippet. The best way to get it properly formatted is to just paste it, then highlight the code, and hit the "Code Sample"-button (the one with the "101010" on it).
Also, pay attention to the dynamically updated preview of your post right underneath the textbox - it displays what your post is going to look like. Just play around with the highlighting and the 101010-button until it looks right. It'll increase your chances of getting help for sure. :)