Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Possible Duplicate:
Add increase/decrease tab indent buttons to the editor toolbar

When posting code inside a list you need to indent it by an additional level, i.e. 8 instead of just 4 spaces. The CTRL+K shortcut and the Code button of the editor use the regular 4-space indentation though which is annoying since it requires indenting all the code manually.

share|improve this question

marked as duplicate by Cody Gray, Arjan, Manishearth, kiamlaluno, jonsca Jul 18 '12 at 3:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

This is a very well-known issue. – John Saunders Mar 20 '12 at 11:54
Doesn't make it less annoying :) – ThiefMaster Mar 20 '12 at 13:41
up vote 5 down vote accepted

As a workaround:

  • Format your code using Ctrl-K:

    - List item
         Code line 1
         Code line 2
  • Add a dummy character at the very start of the first (formatted) line:

    - List item
    x     Code line 1
         Code line 2
  • Select all lines of code, hit Ctrl-K again.

  • Remove the dummy character:

    - List item
            And easier than letting the editor guess what you want...
share|improve this answer

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