Sean Leonard
2014-Oct-10 15:56 UTC
(text/markdown) link label vs. link identifier and last-one-wins
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>
Michel Fortin
2014-Oct-10 16:11 UTC
(text/markdown) link label vs. link identifier and last-one-wins
Le 10-oct.-2014 ? 11:56, Sean Leonard <dev+ietf at seantek.com> a ?crit :> On this basis, I am going to call it "link identifier". Questions?It is called both a "label", an "identifier", and a "name" under the [link][] section of the syntax description on Daring Fireball. Choose as you like. [link]: http://daringfireball.net/projects/markdown/syntax#link> 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?Well, it is not specified in the official documentation. You can always check on Babelmark 2 to see how various implementations are doing it: <http://johnmacfarlane.net/babelmark2/?normalize=1&text=%5Blink%5D%5B%5D%0A%0A%5Blink%5D%3A+1%0A%5Blink%5D%3A+2>> 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.I don't understand what all this has to do with a spec for a MIME type. -- Michel Fortin michel.fortin at michelf.ca http://michelf.ca -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4154 bytes Desc: not available URL: <https://pairlist6.pair.net/pipermail/markdown-discuss/attachments/20141010/9cbdd430/attachment.bin>