Gunanaresh
Gunanaresh

Reputation: 979

How to embed <pre> tag in a list in a wiki

I am trying to embed a <pre> tag in within an ordered list, of the form:

# Some content
#: <pre>
Some pre-formatted content
</pre>

But it doesn't work. Can someone please let me know on how to achieve what I am trying to do?

Upvotes: 6

Views: 3490

Answers (3)

miken32
miken32

Reputation: 42751

The solution I got from this answer at Webmasters SE works for me:

# Some content
# <source>
Some pre-formatted content
</source>
# Some more content

Although the <source> tag is deprecated and modern markup should look like this:

# Some content
# <syntaxhighlight>
Some pre-formatted content
</syntaxhighlight>
# Some more content

If your pre content is code, you can use a language such as <syntaxhighlight lang="php"> to get syntax highlighting.

Upvotes: 1

Kory Lovre
Kory Lovre

Reputation: 144

This is the better answer for continuing a numbered list after using the <pre> tag without resorting to html:

# one
#:<pre>
#:some stuff
#:some more stuff</pre>
# two

Produces:

  • 1. one
       some stuff
       some more stuff
  • 2. two

    Upvotes: -2

  • Tgr
    Tgr

    Reputation: 28220

    You can use a regular HTML list:

    <ol>
    <li>Some Content</li>
    <li><dl><dd><pre>Some pre-formatted content</pre></dd></dl></li>
    </ol>
    

    Upvotes: 6

    Related Questions