[Link] shortcut

John Gruber gruber at fedora.net
Mon Sep 19 02:33:10 EDT 2005


Michel Fortin <michel.fortin at michelf.com> wrote on 3/21/05 at 2:41 PM:


> Le 21 mars 2005, à 12:17, John Gruber a écrit :

>

> > Here's a problem that's occurred to me, however. If you have adjacent

> > links like this:

> >

> > Check out [this] [that] and [the other].

> >

> > [this]: /this/

> >

> > [that]: /that/

> >

> > [the other]: /theother/

> >

> > You're going to get unexpected output:

> >

> > <p>Check out <a href="/that/">this</a> and <a href="/theother/">the

> > other</a>.</p>

>

> Hum, couldn't we do better? When finding `[this] [that]`, Markdown

> checks if there is a label named "this". If such a label exists,

> Markdown makes two links using the new syntax. So:

>

> Check out [this] [that] and [the other].

>

> [this]: this

> [that]: that

> [the other]: the_other

>

> gives three links while:

>

> Check out [this] [that] and [the other].

>

> [that]: that

> [the other]: the_other

>

> give two links.


Looking at this now, I think the current implementation is correct.
Even when you have a link defined for `[this]` and `[that]`, I think

[this] [that]

should be parsed as:

link text: this
link reference: that

rather than treating it the same as:

[this][] [that][]

My thinking is that the "standard" syntax should have higher
precedence.

-J.G.


More information about the Markdown-Discuss mailing list