Multiline code block within a list

John MacFarlane jgm at berkeley.edu
Mon Nov 7 16:22:23 EST 2011


discount, PHP markdown, lunamark, pandoc2, and possibly others
allow a code block as sole list item; you just need make sure that the text
starts in the 8th column (where the list marker is the 1st column):

* hi
hi

<ul>
<li><pre><code>hi
hi
</code></pre></li>
</ul>

The ``` syntax for code blocks is a github addition, not supported
by most other implementations. However, several implementations support
"fenced code blocks" like this:

~~~~
code
~~~~

pandoc allows these as sole list items.

* ~~~~
code
~~~~

+++ Thomas Leitner [Nov 07 11 21:55 ]:

> On 2011-11-08 01:08 +0800 Ryan Chan wrote:

> > Actually this is one of the limitation that I went to reST...sad to

> > hear the suitation is still the same..



More information about the Markdown-Discuss mailing list