Beetlejuice
Beetlejuice

Reputation: 4425

Using code blocks in markdown after "*"

I'm not getting the correctly format when using code block after a "*" mark, like this:

* Here are the places
  * blablabla
  * unit X:

for(I=0;I<100;I++)
{
  ....
}  

it looks like:

Upvotes: 0

Views: 82

Answers (1)

Chris
Chris

Reputation: 136995

Separate your list and your code block with an empty HTML comment:

* Here are the places
* blablabla
    * unit X:

<!-- -->

    for(I=0;I<100;I++) { .... }

Rendered:

  • Here are the places
  • blablabla
    • unit X:
for(I=0;I<100;I++) { .... }

As noted below, some renderers will accept a language hint in the comment.

Also, nested lists should use four spaces at each level of indentation.

Upvotes: 1

Related Questions