The Ping Plan

Justin Mason jm at jmason.org
Fri Apr 30 15:26:10 EDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


John Gruber writes:
> 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 

Just a note from EtText-land:  this can be tricky in my experience. What
should be done if there's a link like:

      My name is Justin and my homepage is here [jmhome].

          [jm_home]: http://jmason.org/

- - (a) should the "[jmhome]" text remain as plain-text, on the assumption
  that it was a quoted footnote from e.g. an email?

- - (b) should it be assumed that "[jmhome]" was a typo, and a warning
  issued, and the text remain as plain-text?

- - (c) should it be assumed that "[jmhome]" was a typo, and a warning
  issued, and the "[jmhome]" text be stripped from the output?

I originally did (a), but then changed it to (c), as I kept typo'ing link
refs by accident, and they looked ugly in the output.  Both are a little
suboptimal.   Eventually I changed the default link format to avoid
supporting this syntax because of this confusion.

> 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 [.,;].

FWIW, that's exactly what ExText does.  If the URL ends in a 
punct char, assume it's strippable from the link.

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFAkqhSQTcbUG5Y7woRAnZbAKCnxYaTQh8oFWSP20cLv5s0IKwzZgCg2G0i
owWXDbARhhkZSjwe43gonv0=
=+AVd
-----END PGP SIGNATURE-----



More information about the Markdown-discuss mailing list