Pandoc vs Markdown.pl

jgm edited this page Oct 12, 2012 · 3 revisions

List of cases where `Markdown.pl` fails and Pandoc does the right thing.

Babelmark test cases

Babelmark is a web page that allows you to compare various markdown implementations (thanks to Michel Fortin and Tom Doran). Here are some of my favorites:

Indentation in multiple blocks in list items

http://thread.gmane.org/gmane.text.markdown.general/2341/focus=2342

Indented code in list item

Just a small test

     This is some code

         and some indented code

and this is the end

1.  Just a small test

         This is some code

             and some indented code

     and this is the end

Markdown.pl yields

<p>Just a small test</p>

<pre><code> This is some code

     and some indented code
</code></pre>

<p>and this is the end</p>

<ol>
<li><p>Just a small test</p>

<pre><code> This is some code


<pre><code> and some indented code
</code></pre>

</code></pre>

<p>and this is the end</p></li>
</ol>

Nested divs

<div>
<div>
text
</div>
</div>

Markdown.pl yields

<div>
<div>
text
</div>

<p></div></p>

Note: This is fixed in Markdown.pl 1.0.2.

Unordered list followed by ordered list

This should be an unordered list followed by an ordered one:

 - foo
 - bar

 1. first
 1. second

Markdown.pl yields

<h1>Test case</h1>

<p>This should be an unordered list followed by an ordered one:</p>

<ul>
<li>foo</li>
<li><p>bar</p></li>
<li><p>first</p></li>
<li>second</li>
</ul>

See also: http://bugs.debian.org/368413

Unordered lists and horizontal rules

Input:

+   item 1

    +   item 2

  *   *   *   *   *

Markdown.pl's output:

<ul>
<li><p>item 1</p>

<ul><li><p>item 2</p></li>
<li><ul><li><ul><li><ul><li>*</li></ul></li></ul></li></ul></li></ul></li>
</ul>

Unpredictable sublists

(Courtesy of Allan Odgaard)

   * item 1
 * item 1a
   * item 2
* item 2a
 * item 2b
  * item 2c
   * item 3

And

 8. item 1
 9. item 2
10. item 2a

In both cases, Markdown.pl produces sublists (in the way indicated by the item numbering) and pandoc does not.

Nested emphasis and strong emphasis

***bold** in italics*

Markdown.pl's output:

<p><strong><em>bold</strong> in italics</em></p>

Failure to escape < in certain contexts

Markdown.pl turns

x<max(a,b)

into

<p>x<max(a,b)</p>

where it should be

<p>x&lt;max(a,b)</p>