I posted this answer, but code formatting hasn't worked. Since it's simply (?) a matter of indenting code by four spaces and a blank line before and after, I suspect this shouldn't be a browser issue.

Is code formatting working on civicrm.stackexchange.com?


I was able to get this to work:

  • Bullet
  • Bullet followed by blank line

    Here is some code which I indented 8 spaces.
  • Bullet preceded by blank line.

  • Hmm ... I had blank lines also but nvm, all good now Mar 27 '15 at 0:35
  • I think the key is that code is normally indented 4 lines, but code in a bulleted list is indented 8 lines.
    – Coleman
    Mar 27 '15 at 0:36
  • Right, double indent or clear the block with a "normal" para. Mar 27 '15 at 0:39

If you want code inside a list you need to indent 8 spaces, 4 for the list and 4 for the code.


Answer: Yes, it is working, but a single blank line doesn't clear a list block apparently.

This doesn't work:

  • list item
  • list item (followed by blank line)

    code sample (indented four spaces)

This does work:

  • list item
  • list item (followed by blank line)

Regular text with no space prefix.

code sample (indented four spaces).

So, the solution was to insert a line of text (= normal block) between the list and the code sample.

You must log in to answer this question.

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