pre in lists

Boris Le Ninivin boris.leninivin at gmail.com
Fri Aug 17 10:28:48 EDT 2012


On 08/17/2012 03:57 PM, Waylan Limberg wrote:

> On Fri, Aug 17, 2012 at 3:57 AM, Boris Le Ninivin

> <boris.leninivin at gmail.com> wrote:

> [snip]

>> Thank you for your suggestion. However, I use ikiwiki, and, if I do so, it's

>> to avoid using php, ruby or anything else ;)

>>

>> So, I'll rather patch ikiwiki than install a hanful of packages to solve a

>> simple problem ;)

>>

> Well, as far as I can tell, ikiwiki is written in Perl. Not sure which

> perl implementation it uses (there are 3 IIRC), but I believe all of

> them implement nested code blocks properly. Perhaps you are providing

> bad input? What you should have is:

>

> ~~~~~~~~~~~~~~~~~~~~~

> 1. some text

> 2. some code :

>

> My first line of code

> The second one

> Some indented code

> Another line

> 3. end of the list

> ~~~~~~~~~~~~~~~~~~~~~

>

> Note the blank line before the block and at least 8 spaces of indent.

> That is the only way to nest a standard markdown style code block

> inside a list.

>

> Remember, without the blank line, you just add more inline text to the

> list item and with only 4 spaces of indent you only get a paragraph

> inside a list:

>

> ~~~~~~~~~~~~~~~~

> 1. First line of first paragraph in list item.

> Second line of first paragraph in list item (indented 4 spaces).

>

> Second paragraph of first list item (indented 4 spaces).

> Second line of second paragraph (indented 4 spaces).

>

> A code block nested in list item (indented 8 spaces).

>

> Another paragraph nested in list item (indented 8 spaces).

>

> 2. A new list item.

> ~~~~~~~~~~~~~~~~

>

> Hope that helps.

>

Hey! Thank you!

That works like a charm. It was missing the newline, I guess...


More information about the Markdown-Discuss mailing list