Skip to content

Latest commit

 

History

History
85 lines (53 loc) · 4.92 KB

Link reference definitions.md

File metadata and controls

85 lines (53 loc) · 4.92 KB

{{($page.frontmatter.start = 161) ? null : null}}

Link reference definitions

link reference definition consists of a link label, indented up to three spaces, followed by a colon (:), optional whitespace (including up to one line ending), a link destination, optional whitespace (including up to one line ending), and an optional link title, which if it is present must be separated from the link destinationby whitespace. No further non-whitespace characters may occur on the line.

link reference definition does not correspond to a structural element of a document. Instead, it defines a label which can be used in reference links and reference-style images elsewhere in the document. Link reference definitions can come either before or after the links that use them.

The title may extend over multiple lines:

However, it may not contain a blank line:

The title may be omitted:

The link destination may not be omitted:

However, an empty link destination may be specified using angle brackets:

The title must be separated from the link destination by whitespace:

Both title and destination can contain backslash escapes and literal backslashes:

A link can come before its corresponding definition:

If there are several matching definitions, the first one takes precedence:

As noted in the section on Links, matching of labels is case-insensitive (see matches).

Here is a link reference definition with no corresponding link. It contributes nothing to the document.

Here is another one:

This is not a link reference definition, because there are non-whitespace characters after the title:

This is a link reference definition, but it has no title:

This is not a link reference definition, because it is indented four spaces:

This is not a link reference definition, because it occurs inside a code block:

link reference definition cannot interrupt a paragraph.

However, it can directly follow other block elements, such as headings and thematic breaks, and it need not be followed by a blank line.

Several link reference definitions can occur one after another, without intervening blank lines.

Link reference definitions can occur inside block containers, like lists and block quotations. They affect the entire document, not just the container in which they are defined:

Whether something is a [link reference definition] is independent of whether the link reference it defines is used in the document. Thus, for example, the following document contains just a link reference definition, and no visible content: