Autolinks
Autolinks are absolute URIs and email addresses inside <
and >
. They are parsed as links, with the URL or email address as the link label.
A URI autolink consists of <
, followed by an absolute URI followed by >
. It is parsed as a link to the URI, with the URI as the link’s label.
An absolute URI, for these purposes, consists of a scheme followed by a colon (:
) followed by zero or more characters other than ASCII whitespace and control characters, <
, and >
. If the URI includes these characters, they must be percent-encoded (e.g. %20
for a space).
For purposes of this spec, a scheme is any sequence of 2–32 characters beginning with an ASCII letter and followed by any combination of ASCII letters, digits, or the symbols plus (”+”), period (”.”), or hyphen (”-”).
Here are some valid autolinks:
Example 602
Markdown | HTML | Demo |
---|---|---|
|
|
Example 603
Markdown | HTML | Demo |
---|---|---|
|
|
Example 604
Markdown | HTML | Demo |
---|---|---|
|
|
Uppercase is also fine:
Example 605
Markdown | HTML | Demo |
---|---|---|
|
|
Note that many strings that count as absolute URIs for purposes of this spec are not valid URIs, because their schemes are not registered or because of other problems with their syntax:
Example 606
Markdown | HTML | Demo |
---|---|---|
|
|
Example 607
Markdown | HTML | Demo |
---|---|---|
|
|
Example 608
Markdown | HTML | Demo |
---|---|---|
|
|
Example 609
Markdown | HTML | Demo |
---|---|---|
|
|
Spaces are not allowed in autolinks:
Example 610
Markdown | HTML | Demo |
---|---|---|
|
|
Backslash-escapes do not work inside autolinks:
Example 611
Markdown | HTML | Demo |
---|---|---|
|
|
An email autolink consists of <
, followed by an email address, followed by >
. The link’s label is the email address, and the URL is mailto:
followed by the email address.
An email address, for these purposes, is anything that matches the non-normative regex from the HTML5 spec:
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?
(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
Examples of email autolinks:
Example 612
Markdown | HTML | Demo |
---|---|---|
|
|
Example 613
Markdown | HTML | Demo |
---|---|---|
|
|
Backslash-escapes do not work inside email autolinks:
Example 614
Markdown | HTML | Demo |
---|---|---|
|
|
These are not autolinks:
Example 615
Markdown | HTML | Demo |
---|---|---|
|
|
Example 616
Markdown | HTML | Demo |
---|---|---|
|
|
Example 617
Markdown | HTML | Demo |
---|---|---|
|
|
Example 618
Markdown | HTML | Demo |
---|---|---|
|
|
Example 619
Markdown | HTML | Demo |
---|---|---|
|
|
Example 620
Markdown | HTML | Demo |
---|---|---|
|
|