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.


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.

  • 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. – Ross Rogers Jan 5 '10 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. – quack quixote Jan 6 '10 at 0:32
  • 1
    @~quack - agreed (but there'd need to be an undo button, too). – Jonathan Leffler Jan 6 '10 at 4:37
  • @Jonathan Leffler: isn't that what Ctrl-Z is for? :) but yeah, a separate undo button would be ok. – quack quixote Jan 7 '10 at 10:09

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