When adding code, it can help to use a code block (plus sign in the toolbar) as this should maintain indentation and whatnot.