Maybe this has been reported before, but I can't find it in the archives. A code block immediately following an ordered or unordered list breaks both the list and the code block. Badly. Tab or spaces for the block don't matter, legal indentation variants of the list don't matter. Tried a bunch of casual workarounds, extra newlines, etc., but no joy. Needs explicit <pre><code> -- which also fixes the preceding list, however Markdown then wraps the <pre> block in a paragraph. PHP Markdown Extra does not. Reproducible in current Markdown, PHP Markdown Extra, and Maruku. LQ Input: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Some text. * I am * a list I, on the other hand, am a code block. My lines are indented four spaces. More text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Output: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <p>Some text.</p> <ul> <li>I am</li> <li><p>a list</p> <p>I, on the other hand, am a code block. My lines are indented four spaces.</p></li> </ul> <p>More text.</p> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lou Quillio wrote:> Maybe this has been reported before, but I can't find it in the > archives.Yes, at the very least Michael Sheets has this somewhere in his list of broken edge cases. There are dozens of such problems at the margins in current Markdown, mostly stemming from its lack of a real grammar/parser. Unfortunately there has been stiff (not particularly logical IMO) resistance to formalizing markdown on this mailing list. -Jacob Rus
Le 2007-08-03 ? 11:16, Lou Quillio a ?crit :> Input: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Some text. > > * I am > * a list > > I, on the other hand, am a code block. My lines are > indented four spaces. > > More text. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This is simply because code blocks and the content of a list item with block-level content are denoted by the same thing: four space of indentation. To be able to create list items with block-level content, it is necessary to interpret indented content after a list item as the continuation of the content of that particular item. This creates the impossibility to create a code block immediately following a list, but the other option would be the impossibility of having block-level content (like paragraphs) inside a list item. This has been reported a couple of time already. The current workaround is to insert an HTML comment, unindented, between the list and the code block. That's clearly not optimal however. Michel Fortin michel.fortin at michelf.com http://www.michelf.com/