In MediaWiki (wikipedia's) wiki syntax, is there a way to have a numbered list with a code block in the middle?
For example:
# Number 1 # Number 2 Indented section that will become a code block # Number 3 # Number 4
What happens in MediaWiki is you end up with something like this:
1. Number 1 2. Number 2 Indented section that will become a code block 1. Number 3 2. Number 4
(Note how "Number 3" and "Number 4" are reset as 1 and 2... It looks like StackOverflow is much smarter than MediaWiki, i had to put my example in PRE tags to make it screw up!)
I know you can indent text using "#:" syntax...
# Number 1 # Number 2 #: Indented section that will merely be indented # Number 3 # Number 4
...but I really would like to get the same visual CSS class for my code even if it's in a numbered list.
It gets even more entertaining with nested lists. This syntax...
# MainEntry 1 ## Number 1 ## Number 2 # MainEntry 2 ## Number 1 ## Number 2 Indented section that will become a code block ## Number 3 ## Number 4
...becomes...
1. MainEntry 1 1. Number 1 2. Number 2 2. MainEntry 2 1. Number 1 2. Number 2 Indented section that will become a code block 1. 1. Number 3 2. Number 4
(Note how "Number 3" is now "1. 1.")
You could try the following wiki syntax, it works for me on 1.17
# one
#:<pre>
#::some stuff
#::some more stuff</pre>
# two
It is not perfect, because you end up with a more indent but it does allow one to use the wiki syntax for correctly formatted pre blocks over multiple lines.
As previously mentioned, the other proper way would be to use HTML mark up.
<ol>
<li>one</li>
<li>two</li>
<pre>some stuff
some more stuff</pre>
<li>three</li>
</ol>