When I want to list a few things and give a code example below each item how can I do it without writing anything between the list item and the code block?

Example:

  • List item

    Code example not formatted as code

  • List item

text

Code example formatted as code
share

1 Answer 1

up vote 8 down vote accepted

Normally, code blocks are formatted using four spaces of indentation:

var string = 'string';
  • In a list, code blocks require eight spaces:

    var string = 'string';
    
  • After a list, a code block can be made using four spaces of indentation, but it needs to be after an intervening <!-- comment -->.

var string = 'string';
share

You must log in to answer this question.

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