Try using the code block for code snippets in the posts for better formating