evolving the spec (was: forking Markdown.pl?)

Allan Odgaard 29mtuz102 at sneakemail.com
Sun Mar 2 01:22:05 EST 2008



On 1 Mar 2008, at 19:19, David Parsons wrote:


>> I agree that Markdown needs to be defined unambiguously, but I don't

>> think that's feasible with plain English [...]

>

> I'm not so sure about this. I managed to write a markdown

> implementation without using anything other than the daring

> fireball

> syntax document and MarkdownTest_1.0. And I am by no means a

> Perl programmer.


And no offense, but there must be hundreds of edge-cases where your
implementation disagrees with Markdown.pl.

Have a look e.g. at http://six.pairlist.net/pipermail/markdown-discuss/2006-August/000151.html
for some edge cases related to nesting block elements, where the
outcome is ambiguous, and I am quite sure there are no tests, as
Markdown.pl generates bad HTML for most of them.

A formal grammar defines _exactly_ how things should be, as I argue
here http://six.pairlist.net/pipermail/markdown-discuss/2007-August/000746.html
where I also show how Markdown.pl presently has unintuitive
precedence which is definitely not defined in the syntax document and
something I doubt is in the tests (as the behavior to me is
unattractive, but stems from how Markdown.pl is implemented, and thus
most of the ports as well).

The problem so far has been that the formal syntax normally used to
define grammars does not support Markdown’s notion of embedding, but
as mentioned here http://six.pairlist.net/pipermail/markdown-discuss/2008-February/001002.html
I have had some success with a rule-based implementation that uses a
stack for aggregating rules that needs to be applied to the current
line before it is handed to the regular parser -- this allows a
specification without code and which is unambiguous to edge-cases
since the rules are exhaustive, unlike a document written in English.

Though without changing a lot of edge-case behavior, I find it hard to
see Markdown using such rule-based implementation, so personally I am
favoring a new Markdown-inspired language.



More information about the Markdown-Discuss mailing list