Possible Duplicate:
Code block is not properly formatted when placed immediately after a list item

I wanted to have this code in my post, and I indented things by four spaces. As you can see, it works fine here.

# Spine.app had these as dependencies by default


# d3 was installed via dependencies.json
require 'd3/d3.v2'

but in my actual post (I answered a question), it looks like crap and was not rendered properly: spine.js hem server, hem build FAQ for Windows

What is going on?

  • Because you wrote it inside bullets. – Himanshu Jansari Sep 26 '12 at 6:25
  • 1
  • 1
    Actually, @MrLister, since the goal is to help future visitors just as much as the op, and since there are N possible future visitors and only one op, it's perfectly fine, and encouraged, to answer older questions. – jmort253 Sep 26 '12 at 6:45

You just need to use additional 4 more space (total 8 space) to write code inside bullets like this one.

Code with 4 space outside bullet.
Code with 4 space outside bullet.
  1. Example of bullet.
  2. Example of bullet.

    Code inside bullet with 8 space.
    Code inside bullet with 8 space.
  3. Example of bullet.

  • 1
    It would still be nice if the Ctrl-K/code block shortcut did this. Otherwise it's just a pain in the butt to add each of those 4 extra spaces manually. – Andrew Mao Sep 26 '12 at 17:27

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