: 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
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:
More posts by @Kaufman445
2 Comments
Sorted by latest first Latest Oldest Best
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
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>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.