Implicit Link Names
Jason Clark
jason at jclark.org
Fri Apr 2 16:20:28 EST 2004
On Apr 2, 2004, at 2:38 PM, european bob wrote:
> I don't think the risk is negligible, although I'm in favour of
> [implicit links]. For example, someone cited the example of links that
> look like this[1]. They are extremely common in e-mail, and Markdown
> will be making them look odd. (Actually, I even disagree they're links
> -
> I always understood them to be footnotes ;)
I'm still don't see a problem... I agree with you that such links are
footnotes. Here's the example in question (posted by Aaron Swartz):
[Joe][1] [said][2] this [the other day][3]:
> Can you believe this guy? He can't get through a single paragraph
without lying:
>
>> I'm proud to have been chosen by the American people. [1] I feel
good about this country's direction. I've created jobs. [2] I've made
the environment safer. [2] And I've stuck to my word -- I did just what
I promised I'd do on the campaign trail. [3] I'm a guy you can trust.
[1]: http://joe.org/
[2]: http://joe.org/weblog/29828
[3]: http://me.org/calendar/2004/04/23
The problem is that the author used linknames like [1] [2] [3], and
then blockquoted some text that appears to use email-style footnotes.
It seems simple enough to write the original block like this:
[Joe][x1] [said][x2] this [the other day][x3]
and fix the links accordingly, if you are going to be quoting text with
email-style footnotes. It's even easier to write this:
[Joe] [said] this [the other day][day]
[Joe]: http://example.com/1
[said]: http://example.com/2
[day]: http://example.com/3
If you actually want to have email-style footnotes instead of links,
just escape the link:
This is a test[1]
\[1]: http://example.com/footnote
Remember, if you don't define a link, it doesn't become a link. I
thought the whole concern was over accidentally triggering a link.
> I think the problem is basically what happens when you have a link
> which
> doesn't have a definition. Currently, that falls back to a explicit
> bracketed thing. That strikes me as difficult, because it means a
> spelling mistake will stop it working and - worse - there is no way you
> can detect it at all.
>
I must not be understanding your point. Let's try an example:
This is a [link], and so is [thsi]
[link]: http://example.com/1
[this]: http://example.com/2
I made a typo on the second implicit link. MD should produce this:
<p>This is a <a href="http://example.com/1">link</a>, and so is
[thsi]</p>
The (intended) second link is broken, but I see it when I view the
output (thanks to the [] becoming visible). No different than this:
This is a [link][link], and so is [this][thsi]
[link]: http://example.com/1
[this]: http://example.com/2
>
> If there were cruft to get rid of, I think I'd prefer the inline syntax
> to go ;) I don't think you can get rid of [link][id], because you may
> always want a nickname (link text could be very long). Simply outlawing
> an empty id seems a bit pointless.
>
I wouldn't suggest getting rid of [link][id]. I call [link][] cruft in
this context because it would produce precisely the same output as
[link] so why support two syntaxes, especially when one has extra
punctuation and causes more visible interuption to the text?
> I think I'd prefer something like [inline implicit link]* and
> [inline implicit image]! though... I'm still slightly uneasy about just
> plain [link].
>
I'm really not trying to be argumentative, I just still don't see how
[this] is likely to cause unintended results... at least not often
enough to outweigh the potential benefits. If John releases a version
to the list that allows [implicit links], perhaps we'll find examples
in use that we won't think of otherwise.
Jason Clark <jason at jclark.org>
http://jclark.org/weblog/
More information about the Markdown-discuss
mailing list