From 14f6fb8462d6f030d3df774560fd3771556847b5 Mon Sep 17 00:00:00 2001
From: Jonas Smedegaard [foo]: /url {.ex:hint =ex:hint_after_blank_line} [foo]
[foo]: {.}
+[foo]
+```````````````````````````````` + + The title must be separated from the link destination by spaces or tabs: @@ -3275,6 +3383,28 @@ spaces or tabs: ```````````````````````````````` +The annotation must be separated from the link destination by +spaces or tabs + +```````````````````````````````` example +[foo]:[foo]: bar
+[foo]
+```````````````````````````````` + +```````````````````````````````` example +[foo]: /bar{.ex:hint} + +[foo] +. +[foo]: /bar{.ex:hint}
+[foo]
+```````````````````````````````` + + Both title and destination can contain backslash escapes and literal backslashes: @@ -3287,6 +3417,30 @@ and literal backslashes: ```````````````````````````````` +Annotation can contain backslash escapes +in angle brackets: + +```````````````````````````````` example +[foo]: /url\bar\*baz {.[foo]: /url\bar\*baz {.ex:foo\"bar\baz}
+[foo]
+```````````````````````````````` + + A link can come before its corresponding definition: ```````````````````````````````` example @@ -3297,6 +3451,16 @@ A link can come before its corresponding definition: ```````````````````````````````` +```````````````````````````````` example +[foo] + +[foo]: url {.ex:hint} +. + +```````````````````````````````` + + + If there are several matching definitions, the first one takes precedence: @@ -3310,6 +3474,54 @@ precedence: ```````````````````````````````` +```````````````````````````````` example +[foo] + +[foo]: url {.ex:first} +[foo]: url {.ex:second} +. + +```````````````````````````````` + +```````````````````````````````` example +[foo] + +[foo]: url {.ex:first} +[foo]: url {=ex:second} +. + +```````````````````````````````` + +```````````````````````````````` example +[foo]: url {.ex:first} + +[foo] + +[foo]: url {=ex:second} +. + +```````````````````````````````` + +```````````````````````````````` example +[foo] + +[foo]: url {} + +[foo]: url {=ex:second} +. + +```````````````````````````````` + +```````````````````````````````` example +[foo] + +[foo]: url + +[foo]: url {=ex:second} +. + +```````````````````````````````` + As noted in the section on [Links], matching of labels is case-insensitive (see [matches]). @@ -3322,6 +3534,13 @@ case-insensitive (see [matches]). ```````````````````````````````` +```````````````````````````````` example +[FOO]: /url {.ex:hint} + +[Foo] +. + +```````````````````````````````` ```````````````````````````````` example [ΑΓΩ]: /φου @@ -3331,6 +3550,14 @@ case-insensitive (see [matches]). ```````````````````````````````` +```````````````````````````````` example +[ΑΓΩ]: /φου {.φου:φου φου:φου =φου:φου .<φου> <φου> =<φου>} + +[αγω] +. + +```````````````````````````````` + Here is a link reference definition with no corresponding link. It contributes nothing to the document. @@ -3353,6 +3580,26 @@ bar ```````````````````````````````` +Here are some with annotation: + +```````````````````````````````` example +[foo]: /url {.ex:hint} +. +```````````````````````````````` + +```````````````````````````````` example +[ +foo +]: /url +{ +.ex:hint +} +bar +. +bar
+```````````````````````````````` + + This is not a link reference definition, because there are characters other than spaces or tabs after the title: @@ -3361,6 +3608,22 @@ characters other than spaces or tabs after the title: .[foo]: /url "title" ok
```````````````````````````````` +Here is a bogus annotated one with stuff after title: + +```````````````````````````````` example +[foo]: /url {.ex:hint} "title" ok +. +[foo]: /url {.ex:hint} "title" ok
+```````````````````````````````` + +This is not a link reference definition, +because there are characters other than spaces or tabs or title after annotation: + +```````````````````````````````` example +[foo]: /url {.ex:hint} ok +. +[foo]: /url {.ex:hint} ok
+```````````````````````````````` This is a link reference definition, but it has no title: @@ -3372,6 +3635,16 @@ This is a link reference definition, but it has no title:"title" ok
```````````````````````````````` +Here is an annotated link reference definition, without title: + +```````````````````````````````` example +[foo]: /url {.ex:hint} +"title" ok +. +"title" ok
+```````````````````````````````` + + This is not a link reference definition, because it is indented four spaces: @@ -3385,6 +3658,17 @@ four spaces:[foo]
```````````````````````````````` +Here is a bogus one indented four spaces, with annotation: + +```````````````````````````````` example + [foo]: /url {.ex:hint} "title" + +[foo] +. +[foo]: /url {.ex:hint} "title"
+
+[foo]
+```````````````````````````````` This is not a link reference definition, because it occurs inside @@ -3402,6 +3686,21 @@ a code block:[foo]
```````````````````````````````` +Here is an annotated bogus link reference definition in code block: + +```````````````````````````````` example +``` +[foo]: /url {.ex:hint} +``` + +[foo] +. +[foo]: /url {.ex:hint}
+
+[foo]
+```````````````````````````````` + + A [link reference definition] cannot interrupt a paragraph. @@ -3416,6 +3715,17 @@ Foo[bar]
```````````````````````````````` +```````````````````````````````` example +Foo +[bar]: /baz {.ex:hint} + +[bar] +. +Foo +[bar]: /baz {.ex:hint}
+[bar]
+```````````````````````````````` + However, it can directly follow other block elements, such as headings and thematic breaks, and it need not be followed by a blank line. @@ -3431,6 +3741,17 @@ and thematic breaks, and it need not be followed by a blank line. ```````````````````````````````` +```````````````````````````````` example +# [Foo] +[foo]: /url {.ex:hint} +> bar +. +++```````````````````````````````` + ```````````````````````````````` example [foo]: /url bar @@ -3441,6 +3762,16 @@ bar ```````````````````````````````` +```````````````````````````````` example +[foo]: /url {.ex:hint} +bar +=== +[foo] +. +bar
+
=== +foo
+```````````````````````````````` + Several [link reference definitions] can occur one after another, without intervening blank lines. @@ -3469,6 +3809,22 @@ can occur one after another, without intervening blank lines. baz ```````````````````````````````` +```````````````````````````````` example +[foo]: /foo-url {.ex:first} "foo" +[bar]: /bar-url +{.ex:second} + "bar" +[baz]: /baz-url {.ex:third} + +[foo], +[bar], +[baz] +. + +```````````````````````````````` + [Link reference definitions] can occur inside block containers, like lists and block quotations. They @@ -3485,6 +3841,16 @@ are defined: ```````````````````````````````` +```````````````````````````````` example +[foo] + +> [foo]: /url {.ex:hint} +. + +++```````````````````````````````` + Whether something is a [link reference definition] is independent of whether the link reference it defines is @@ -3497,6 +3863,11 @@ no visible content: . ```````````````````````````````` +```````````````````````````````` example +[foo]: /url {.ex:hint} +. +```````````````````````````````` + ## Annotation reference definitions -- cgit v1.2.3