Text::Markdown vs MDTest (Was: Re: forking Markdown.pl?)

Tomas Doran bobtfish at bobtfish.net
Fri Mar 21 16:39:00 EDT 2008



On 29 Feb 2008, at 05:17, Michel Fortin wrote:


> Le 2008-02-28 à 18:04, Yuri Takhteyev a écrit :

>> Perhaps there is a need for a better _perl_ implementation (or a few,

>> competition is fun), but as far as "official" goes, we need a

>> comprehensive and up-to-date spec and a test suite against which all

>> implementations could be measured.

>

> I'm maintaining MDTest for that. If anyone wants a new test case to

> be added to MDTest, I'll gladly accept it. If anyone wants to

> dispute one of MDTest's expected result, I'm open to discussion,

> preferably on this list so that everybody can take part.


As promised, here are the results of MDTest 1.1's Markdown tests
against Text::Markdown's trunk code (what is going to be 1.0.18,
should be exactly the same for the to be released 1.0.17):

tdpb:~/Text-MultiMarkdown t0m$ perl -Ilib t/50mdtest-markdown.t
1..24
ok 1 - use Text::Markdown;
ok 2 - Docs test: Amps and angle encoding
ok 3 - Docs test: Auto links
========================================================================
========
DIFFERENCES: + = processed version from .text, - = template from .html
@@ -101,7 +101,6 @@

<p>Minus: <code>\-</code></p>

-
<p>These should get escaped, even though they're matching pairs for
other Markdown constructs:</p>


not ok 4 - Docs test: Backslash escapes
# Failed test 'Docs test: Backslash escapes'
# at /Users/t0m/Text-MultiMarkdown/t/20fulldocs-multimarkdown.t
line 25.
ok 5 - Docs test: Blockquotes with code blocks
ok 6 - Docs test: Code Blocks
ok 7 - Docs test: Code Spans
ok 8 - Docs test: Hard-wrapped paragraphs with list-like lines
ok 9 - Docs test: Horizontal rules
ok 10 - Docs test: Images
ok 11 - Docs test: Inline HTML (Advanced)
ok 12 - Docs test: Inline HTML (Simple)
ok 13 - Docs test: Inline HTML comments
ok 14 - Docs test: Links, inline style
ok 15 - Docs test: Links, reference style
ok 16 - Docs test: Links, shortcut references
ok 17 - Docs test: Literal quotes in titles
ok 18 - Docs test: Markdown Documentation - Basics
ok 19 - Docs test: Markdown Documentation - Syntax
ok 20 - Docs test: Nested blockquotes
========================================================================
========
DIFFERENCES: + = processed version from .text, - = template from .html
@@ -136,13 +136,14 @@
<li><p>Third</p></li>
</ol>

-
<p>This was an error in Markdown 1.0.1:</p>

<ul>
<li><p>this</p>

-<ul><li>sub</li></ul>
+<ul>
+<li>sub</li>
+</ul>

<p>that</p></li>
</ul>

not ok 21 - Docs test: Ordered and unordered lists
# Failed test 'Docs test: Ordered and unordered lists'
# at /Users/t0m/Text-MultiMarkdown/t/20fulldocs-multimarkdown.t
line 25.
ok 22 - Docs test: Strong and em together
ok 23 - Docs test: Tabs
========================================================================
========
DIFFERENCES: + = processed version from .text, - = template from .html
@@ -1,8 +1,9 @@
<blockquote>
-<p>A list within a blockquote:</p>
-<ul>
-<li>asterisk 1</li>
-<li>asterisk 2</li>
-<li>asterisk 3</li>
-</ul>
+ <p>A list within a blockquote:</p>
+
+ <ul>
+ <li>asterisk 1</li>
+ <li>asterisk 2</li>
+ <li>asterisk 3</li>
+ </ul>
</blockquote>

not ok 24 - Docs test: Tidyness
# Failed test 'Docs test: Tidyness'
# at /Users/t0m/Text-MultiMarkdown/t/20fulldocs-multimarkdown.t
line 25.
# Looks like you failed 3 tests of 24.

So, the *only* things that Text::Markdown currently fails on are
small whitespace changes..

The cases where I have *too many* line breaks I think could do with
fixing, and I'll have a look at how trivial (or not) that turns out
to be..

In the other cases, I think that Text::Markdown's behavior is
*superior* to that of the original Markdown / what the test cases
expect. What do other people think?

I'll shortly be going through the other test cases that I've got of
my own / with the module to see if I can add some to MDTest, and I'll
propose those in a separate mail to the list..

Cheers
Tom



More information about the Markdown-Discuss mailing list