Howdy, Quick question: Since list items with multiple paragraphs need to be indented four spaces, and code blocks are also indented four spaces, is there any way to disambiguate a list followed by a code block? Example: * This is a list item. * And so is this. Is this a second paragraph in the second list item, or a code block? It looks like Markdown.pl and discount agree that it should be a second paragraph. If that is indeed the standard, what should I do if I actually want to follow a list with a code block? Many thanks, David
+++ David E. Wheeler [Feb 18 09 09:33 ]:> Howdy, > > Quick question: Since list items with multiple paragraphs need to be > indented four spaces, and code blocks are also indented four spaces, is > there any way to disambiguate a list followed by a code block? Example: > > * This is a list > item. > * And so is this. > > Is this a second paragraph in the second list item, > or a code block? > > It looks like Markdown.pl and discount agree that it should be a second > paragraph. If that is indeed the standard, what should I do if I actually > want to follow a list with a code block?You can insert an HTML comment between them. It's a kludge, but that's the only way I know of. * This is a list item. * And so is this. <!-- end of list --> Definitely a code block.
On Wed, Feb 18, 2009 at 12:33 PM, David E. Wheeler <david at kineticode.com> wrote:> Howdy, > > Quick question: Since list items with multiple paragraphs need to be > indented four spaces, and code blocks are also indented four spaces, is > there any way to disambiguate a list followed by a code block?This was a hotly discussed issue a while back with all sorts of suggestions. Search the archives. I believe the final consensus was to create an alternate markup for codeblocks, which address both this use case and well as consecutive, but separate, codeblocks. However, I believe that only PHP Extra and Python implementations have implemented fenced code blocks. http://michelf.com/projects/php-markdown/extra/#fenced-code-blocks -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg
On Feb 18, 2009, at 10:19 AM, Waylan Limberg wrote:> This was a hotly discussed issue a while back with all sorts of > suggestions. Search the archives. I believe the final consensus was to > create an alternate markup for codeblocks, which address both this use > case and well as consecutive, but separate, codeblocks. However, I > believe that only PHP Extra and Python implementations have > implemented fenced code blocks. > > http://michelf.com/projects/php-markdown/extra/#fenced-code-blocksAh, right, I forgot about those. Definitely a better workaround. Thanks, David
+++ Waylan Limberg [Feb 18 09 13:19 ]:> On Wed, Feb 18, 2009 at 12:33 PM, David E. Wheeler <david at kineticode.com> wrote: > > Howdy, > > > > Quick question: Since list items with multiple paragraphs need to be > > indented four spaces, and code blocks are also indented four spaces, is > > there any way to disambiguate a list followed by a code block? > > This was a hotly discussed issue a while back with all sorts of > suggestions. Search the archives. I believe the final consensus was to > create an alternate markup for codeblocks, which address both this use > case and well as consecutive, but separate, codeblocks. However, I > believe that only PHP Extra and Python implementations have > implemented fenced code blocks. > > http://michelf.com/projects/php-markdown/extra/#fenced-code-blockspandoc too: http://johnmacfarlane.net/pandoc/README.html#delimited-code-blocks