2

Possible Duplicate:
Why is a code block not properly formatted when placed immediately after a list item?

If you look at my post ( 3rd down ) on this stack overflow page, you'll see that my code isn't highlighted. Even though my code is indented by 4 spaces, I had to use the <PRE> tags around my code to get mono-space font. If you take away the surrounding <PRE> tags, the code is interpreted as normal text, even though it is indented.

1

1 Answer 1

7

It was in a list. In a list you have to indent it by 8 spaces.

Rich fixed this by adding a rule before the code, to effectively separate it from the list.

4
  • Thanks for the explanation. Perhaps the behavior of the "Code sample" button could be enhanced to do the 8 space indentation in the context of a list. When I press the "code sample" button it only indents by 4-spaces. Commented Jan 5, 2010 at 21:35
  • 1
    or better yet, have the "code sample" button always indent 4 spaces on a press, instead of toggling the 4 spaces on or off. then i can press it twice if i need the extra indentation. Commented Jan 6, 2010 at 0:32
  • 1
    @~quack - agreed (but there'd need to be an undo button, too). Commented Jan 6, 2010 at 4:37
  • @Jonathan Leffler: isn't that what Ctrl-Z is for? :) but yeah, a separate undo button would be ok. Commented Jan 7, 2010 at 10:09

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