Code snippets inside lists (Creole wiki)

While Wikis and Wikipedia are still in Area 51, I would like to ask this question about using the Creole wiki markup. I have the following code:

# Initial instructions here. # Some instructions here. See code snippet below. {{{ #!python def foo(): return bar }}} # More instructions here. Why does the numbering restart at 1? # Final instructions. 

When this code is processed, I get the following:

1. Initial instructions here. 2. Some instructions here. See code snippet below.
  def foo ():
   return bar
1. Longer instructions here. Why restart numbering at 1? 2. Final instructions.

Question: How to insert code fragments into the list so that the list elements below the code fragment do not restart with number 1?

+4
source share
1 answer

Built-in pre-formatted text works in lists. You can use this to approximate the block pre-formatting by separating each line. This is not a great solution, but in some cases it may work.

 # Initial instructions here. # Some instructions here. See code snippet below. ** {{{#!python}}} ** {{{}}} ** {{{def foo():}}} ** {{{ return bar}}} # More instructions here. Why does the numbering restart at 1? # Final instructions. 

Yeilds:

 <ol> <li>Initial instructions here.</li> <li>Some instructions here. See code snippet below. <ul> <li><tt>#!python</tt></li> <li><tt></tt></li> <li><tt>def foo():</tt></li> <li><tt> return bar</tt></li> </ul></li> <li>More instructions here. Why does the numbering restart at 1?</li> <li>Final instructions.</li> </ol> 
0
source

All Articles