[kramdown-users] is this rule necessary?

Matt Neuburg matt at tidbits.com
Fri Aug 6 03:07:24 EDT 2010

On or about 8/5/10 11:44 PM, thus spake "Thomas Leitner" <t_leitner at gmx.at>:

> I have tested the following Markdown document
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> some [link](hal lo.html)
> some [link](<hal lo.html>)
> some [link](hal lo.html "title")
> some [link](<hal lo.html> "title")
> some [link](hallo.html)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> with kramdown/maruku/PHP Markdown/PHP Markdown
> Extra/Markdown.pl/Python Markdown. The only converter that converts all
> the above links is Python Markdown, the original Markdown.pl as well
> as maruku/PHP Markdown/PHP Markdown Extra do only convert the last one,
> the one without the space!

I have always used the original Markdown.pl:

 $VERSION = '1.0.1';
 # Tue 14 Dec 2004

The following document:

 This is [a test](of links) in Markdown.

Comes out as follows:

 <p>This is <a href="of links">a test</a> in Markdown.</p>

I'll send you the Perl script if you like.

I also have an unreleased experimental version called 1.0.2b7:

 $VERSION = '1.0.2b7';
 # Tue 29 Aug 2006

The same document comes out the same way. Again, I'll send you the Perl
script if you wish.

So, that's two for two in my favor. :) I have literally thousands of pages
that depend upon this behavior.

Moreover, I have never seen *any* account of the original Markdown syntax
requiring or even mentioning the (<...>) construct. It is something that
kramdown introduces. The documentation does describe it but does not point
out that this is a difference from Markdown.

Plus, I would suggest that (<...>) is a possible candidate for Occam's
razor, since what does it accomplish that simple (...) does not? That is,
what are we trying to distinguish by addition of the angle brackets? Under
what circumstances would [...](...) *not* be intended as an inline link? And
in any case, if it *were* intended as not a link, that would be a case for
escaping the first square bracket. That is what the original Markdown
expects. So this:

 This is \[a test](of links) in Markdown.

Causes the brackets and parentheses to be left alone.

The only case that can cause ambiguity is where the parentheses themselves
contain parentheses. In that case I suggest that the rule should be that as
long as nesting is regular, no angle brackets should be needed. So:

 This should [work](to (make) a link).

But in the (extremely unlikely!) case of irregular nesting, then and only
then, I can see why the angle brackets are needed:

  Someone is [out](<of (his mind>) in this example.


matt neuburg, phd = matt at tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
Take Control of Exploring & Customizing Snow Leopard
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com

More information about the kramdown-users mailing list