Mobile app version of vmapp.org
Login or Join
Kaufman445

: Numbered MediaWiki List with pre,source or code tags inside How can I create a numbered list containing multi line pre, source or code tags without breaking the list? That is what I have been

@Kaufman445

Posted in: #Mediawiki

How can I create a numbered list containing multi line pre, source or code tags without breaking the list?

That is what I have been trying:

# First
# Second <source lang="CSharp">Some
Multi
Line C Sharp
Code </source>
# Trid


It results in something like:

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Kaufman445

2 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

The other answer is incorrect. This can be done using the line option:

# First
# Second <source line lang="CSharp">Some
Multi
Line C Sharp
Code </source>
# Third


Look, the output is correct: www.mediawiki.org/w/index.php?title=Project:Sandbox&oldid=1915324

10% popularity Vote Up Vote Down


 

@Rivera981

I don't think that can be done with pure wiki markup. From the lists help page on mediawiki.org:


For simplicity, list items in wiki markup cannot be longer than a paragraph. A following blank line will end the list and reset the counter on ordered lists. Separating unordered list items usually has no noticeable effects.

Paragraphs can be forced in lists by using HTML tags. Two line break symbols, <br /><br />, will create the desired effect. So will enclosing all but the first paragraph with <p>...</p>


This works for normal paragraphs, but not for multiline code blocks because they need actual newlines.

However, MediaWiki does support some HTML tags, including <ol> and <ul>, so you can obtain the desired affect using HTML markup, like so:



<ol>
<li>First</li>
<li>Second
<source lang="CSharp">Some
Multi
Line C Sharp
Code
</source></li>
<li>Third</li>
</ol>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme