The Ping Plan

John Gruber gruber at fedora.net
Fri Apr 30 14:20:12 EDT 2004


Aaron Swartz <aaronsw at gmail.com> wrote on 04/29/04 at 10:02p:

>     Foo bar baz.[1]
>     
>     [1]: http://lfw.org/

What does he want this to produce? Something like:

    Foo bar baz.<a href="http://lfw.org/">1</a>

?


> So that's good. He also wanted the :s to be optional, so this would work:
> 
>     Foo bar baz.[1]
>     
>     [1] http://lfw.org/

The point of the :'s in link defs is purely defensive. Because they
get stripped from the output, it's essential that the syntax be such
that it's very unlikely to happen by accident.

Sure, when the bracketed link id is followed by "http:", that's
pretty unambiguous. But what about links to local resources? This is
a reasonable thing to link to:

    [foo]: bar

Whereas

    [foo] bar

strikes me as a dangerous thing to strip from the output.

At the very least, these first two requests are mutually exclusive.
If we hook up "just brackets" as an auto-linking shortcut, then
there's no way we can strip

    [foo] bar

as a link definition -- it's indistinguishable from a two-word
paragraph, where "foo" is an auto-linked word.

* * *

The first request, auto-linking using just brackets, seems like the
better idea. Markdown's primary goal is readability of the source,
and this idea would help in that regard. [This] is 

Whereas the second idea -- making the :'s optional in link defs --
is just about being lazy. It makes parsing more ambiguous, and it
provides very little convenience to the writer. I actually like the
colons, which seem to me a very natural form of punctuation for a
definition.


> Finally, he wanted links to work without angle brackets, so this would work:
> 
>     Hey, check out Jon's website at http://www.jontheman.info
> 
[...]
> I don't see why any of these wouldn't work; other than the first,
> they're all pretty unambiguous.

Actually, linking URLs without angle-bracket delimiters is slightly
ambiguous. The main problem is with punctuation:

    Just go to http://example.com/foo.

But I suppose a reasonable guess can be made that the last character
of a URL shouldn't be in the class [.,;].

This is a somewhat common request, so I'll probably hook it up.

-J.G.


More information about the Markdown-discuss mailing list