2

I added a comment to the top answer here, I but couldn't get the code to format correctly. I made sure I was entering the four spaces.

The comment was only editable for 5 minutes, and it now appears too late to fix it. What should I do? The comment is important in explaining why I unaccepted the answer.

0

1 Answer 1

4

The 4-space indentation doesn't work in comments. Comments have a very dumbed down version of the full markdown that's available in posts.

The best you can do is put the ticks (``) around your code, using the key in the upper left near the numbers. This will highlight the code. You will not be able to do full indentation and stuff.

7
  • So here is a sentence. Here is some code. That's all you can do in a comment.
    – Mysticial
    Mar 24, 2013 at 3:40
  • are the ticks(``) just a convention? They don't seem to reformat anything? "Here is my test tick"
    – Kirsten
    Mar 24, 2013 at 3:47
  • Look closer. On some browsers on some monitors, it can be really hard to see. Compare "this" with "this". And make you use the correct tick. It's ` and not ' (the apostophe).
    – Mysticial
    Mar 24, 2013 at 3:48
  • The difference is a lot more obvious on larger blocks of code: "if (x < 100) return 0; else return 1;" vs. "if (x < 100) return 0; else return 1;"
    – Mysticial
    Mar 24, 2013 at 3:49
  • testing Compare "this" vs this , The ticks are the same character aren't they? how do you type them?
    – Kirsten
    Mar 24, 2013 at 3:50
  • I think you're using the wrong tick. Use the one on the upper-left corner next to the numbers.
    – Mysticial
    Mar 24, 2013 at 3:51
  • yes - i was using the wrong tick, and also didnt realise that the purpose of the tick was to create a highlight. I submitted an edit to your answer.
    – Kirsten
    Mar 24, 2013 at 3:57

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