``` [basic _link_][a_b_] [a_b_]: url .
``` ``` ![basic _image_][a_b_] [a_b_]: url . ``` ``` [link][] [link]: url . ``` ``` [link][] [link]: url . ``` The URL can be split over multiple lines: ``` [link][] [link]: url andurl . ``` ``` [link](url andurl) . ``` ``` [link][] [link]: [link2]: url . ``` ``` [link][] [link][link2] [link2]: url2 [link]: url . ``` ``` [link][a and b] [a and b]: url . ``` If the reference isn't found, we get an empty link. ``` [link][a and b] . ``` Reference definitions can't have line breaks in the key: ``` [link][a and b] [a and b]: url .[a and b]: url
``` No case normalization is done on reference definitions: ``` [Link][] [link]: /url . ``` Attributes on reference definitions get transferred to the link: ``` {title=foo} [ref]: /url [ref][] . ``` Attributes on the link override those on references: ``` {title=foo} [ref]: /url [ref][]{title=bar} . ``` ``` [link _and_ link][] [link _and_ link]: url . ``` ``` ![basic _image_](url) . ``` ``` [![image](img.jpg)](url) . ``` ``` [unclosed](hello *a b* .[unclosed](hello a b
``` Note that soft breaks are ignored, so long URLs can be split over multiple lines: ``` [closed](hello *a b*) . ``` Here the strong takes precedence over the link because it starts first: ``` *[closed](hello*) .[closed](hello)
``` Avoid this with a backslash escape: ``` *[closed](hello\*) . ``` Link in link? ``` [[foo](bar)](baz) . ``` Link in image? ``` ![[link](url)](img) . ``` Image in link? ``` [![image](img)](url) . ``` Autolinks: ```http://example.com/foo me@example.com
``` Openers inside `[..](` or `[..][` or `[..]{` can't match outside them, even if the construction doesn't turn out to be a link or span or image. ``` [x_y](x_y) . ``` ``` [x_y](x_ .[x_y](x_
``` ``` [x_y]{.bar_} .```