(text/markdown) link label vs. link identifier and last-one-wins

Sean Leonard dev+ietf at seantek.com
Fri Oct 10 11:56:00 EDT 2014


In working on the text/markdown spec, I am making a reference to the 
syntax of links, specifically the things [1] and [Google] used in this 
construct:

    Hello I am some [Markdown][1] and I use [Google][].

    [1]: http://daringfireball.net/projects/markdown/
    [Google]: http://www.google.com/ "This is Google"


What is the common Markdown way of identifying this syntax element?

stmd (CommonMark) consistently calls it the "link label". (To be clear, 
it also calls [Markdown] a link label, even though that element does not 
have the same behavior as [1].)

However, [Markdown Syntax][MDSYNTAX] refers to it once as a "link 
identifier" in the bullet point: "Square brackets containing the *link 
identifier* (optionally indented from the left margin using up to three 
spaces)". Elsewhere it refers to it as a label. For example: 
"Reference-style links use a second set of square brackets, inside which 
you place a label of your choosing to identify the link" and "Then, 
anywhere in the document, you define your link label like this, on a 
line by itself".

I reviewed Markdown.pl, which consistently uses the variable name 
$link_id (see also $g_urls, and comments such as # Link defs are in the 
form: ^[id]: url "optional title").

On this basis, I am going to call it "link identifier". Questions?

Also, Markdown.pl seems to define last-wins behavior: the last link 
definition is indexed as the definition in $g_urls. (See 
_StripLinkDefinitions.) Older ones get overwritten by newer ones. Is 
this common or normative behavior? How do other implementations do it?

It's important that I keep the original reference list short; I would 
rather not refer normatively to documents other than Gruber's own 
Markdown rules.

Sean

[MDSYNTAX]: http://daringfireball.net/projects/markdown/syntax
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist6.pair.net/pipermail/markdown-discuss/attachments/20141010/bae430cf/attachment.html>


More information about the Markdown-Discuss mailing list