3

I'm trying to publish my question, but I'm always getting this message:

Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon.

I paste my code, then I select the code and then I press the code button. It seems fine and indented in the preview, but I'm still getting that message when I try to publish it. Why is this happening?

The preview I get of my message

Enter image description here

Enter image description here

  • 1
    Could you show the whole post? Is that all of your post? – Qantas 94 Heavy Nov 17 '13 at 3:17
  • 1
    Are you still using spaces instead of tabs? – Jamal Nov 17 '13 at 3:26
  • sure, I've just edited my post. @Qantas94Heavy – yat0 Nov 17 '13 at 3:27
  • no, I'm using tabs, and I just copied and pasted my code from my text editor. @Jamal – yat0 Nov 17 '13 at 3:29
  • 2
    @polska: I believe he was being sarcastic - spaces are preferred for the editor. – Qantas 94 Heavy Nov 17 '13 at 3:30
  • 1
    @Qantas94Heavy: I was being serious. I've noticed that tabs cause some annoying indentation issues, and I've had to fix such code. Usually when it's a lot of code, I don't even bother. I still have to do it the slow way. – Jamal Nov 17 '13 at 3:32
  • @Qantas94Heavy , oh, I didn't understand. But actually in the first time I was attempting to correct the problem by indenting myself with spaces in the text editor, so.. :D – yat0 Nov 17 '13 at 3:33
  • 1
    @Jamal: the way you wrote it seems like you're recommending tabs instead of spaces. Are you still using spaces (at least to me) makes it seem like spaces are inferior to tabs. – Qantas 94 Heavy Nov 17 '13 at 3:36
  • 1
    @Qantas94Heavy: No, not at all. I'll delete that since it does seem misleading. – Jamal Nov 17 '13 at 3:39
  • I don't think you need to delete it, like you said after, you have been notice that tabs cause some annoying indentation issues. Anyway, problem solved, thanks guys :) . – yat0 Nov 17 '13 at 3:42
7

It's probably complaining about this line, which you should indent by four spaces (because it's code):

successo = 0; erro = 1; msg_erro = "error message..."

And this one:

Array ( [successo] => 0 [erro] => 1 [msg_erro] => )

You don't just have to indent something that is your sample code. If you're writing small snippets of code in your answer, those should probably indented too.

  • Thanks a lot ! Problem solved :) . – yat0 Nov 17 '13 at 3:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .