Fenced code in a list


#1

Can I have a fenced block inside a list?

Like this:
.

  • Example 1

‘’‘
code for example 1
’’’
.

Should become a list item <ul><li><p>Example 1</p><pre>...</pre></li></ul>.

In other words, can I make this: http://spec.commonmark.org/dingus/?text=-%20Foo ``` %20%20%20%20%20%20bar %20%20%20%20%20%20baz ``` -%20BAR work like this: http://spec.commonmark.org/dingus/?text=-%20Foo %20%20%20%20%20%20bar %20%20%20%20%20%20baz -%20BAR ?


#2

You can—if this is indeed what you’re looking for:

- Foo
  bar

  baz
- BAR

That is: you have to indent the code fences so that they align with the list item where the code is meant to belong.


#3

Thank you, that was it.