Numeric Reference Links

Jelks Cabaniss jelks at jelks.nu
Wed Mar 31 20:47:10 EST 2004


Speaking of simple link syntax, one of the most (if not *the* most)
appealing things about Markdown is how "it's just like email".  And the most
common way of expressing links in emails, aside from directly inline like
http://example.com, or block-indented like

	http://example.com

is the numeric-reference link[1], where the links are usually[2] listed
towards the bottom of the page.

[1] http://example.com/foo
[2] http://example.org/bar



It's too bad that the above, which is a 100% match with the email paradigm,
doesn't work directly, and probably couldn't work.  (or could it?)

The MD-style colon after the bracketed reference ID isn't *that* much of a
jump from that paradigm.  It could turn 

	This is a numeric-reference link[1].

	[1]: http://example.com

into this

	`This is a numeric-reference <a 
	href="http://example.com">link</a>.`

for about a 90% match. :)  If this were adopted, you would have three types
of reference links:

Explicit reference:

	This is [an example link][SomeID].

Implicit reference:

	This is [an example link].

Numeric reference:

	This is an example link[1].

[SomeID]: http://example.com
[an example link]: http://example.com
[1]: http://example.com


It obviously could only make a link out of the word immediately preceding
the bracketed number[s].  And the same strictness would apply here as to the
implicit link styles -- no corresponding reference found, it's not a link
(like in the previous sentence).

And I'm not sure they should even be restricted to numbers; I only though of
it initially this way because that's the way they're normally done on email
lists.  

Just thinking out loud ...


/Jelks



More information about the Markdown-discuss mailing list