packages feed

djot-0.1.0.0: test/links_and_images.test

```
[basic _link_][a_b_]

[a_b_]: url
.
<p><a href="url">basic <em>link</em></a></p>
```

```
![basic _image_][a_b_]

[a_b_]: url
.
<p><img alt="basic image" src="url"></p>
```

```
[link][]

[link]: url
.
<p><a href="url">link</a></p>
```

```
[link][]

[link]:
 url
.
<p><a href="url">link</a></p>
```

The URL can be split over multiple lines:

```
[link][]

[link]:
 url
  andurl
.
<p><a href="urlandurl">link</a></p>
```

```
[link](url
andurl)
.
<p><a href="urlandurl">link</a></p>
```

```
[link][]

[link]:
[link2]: url
.
<p><a href="">link</a></p>
```

```
[link][]
[link][link2]

[link2]:
  url2
[link]:
 url
.
<p><a href="url">link</a>
<a href="url2">link</a></p>
```

```
[link][a and
b]

[a and b]: url
.
<p><a href="url">link</a></p>
```

If the reference isn't found, we get an empty link.

```
[link][a and
b]
.
<p><a href="">link</a></p>
```

Reference definitions can't have line breaks in the key:

```
[link][a and
b]

[a and
b]: url
.
<p><a href="">link</a></p>
<p>[a and
b]: url</p>
```

No case normalization is done on reference definitions:

```
[Link][]

[link]: /url
.
<p><a href="">Link</a></p>
```

Attributes on reference definitions get transferred to
the link:

```
{title=foo}
[ref]: /url

[ref][]
.
<p><a href="/url" title="foo">ref</a></p>
```

Attributes on the link override those on references:

```
{title=foo}
[ref]: /url

[ref][]{title=bar}
.
<p><a href="/url" title="bar">ref</a></p>
```

```
[link _and_ link][]

[link _and_ link]: url
.
<p><a href="url">link <em>and</em> link</a></p>
```

```
![basic _image_](url)
.
<p><img alt="basic image" src="url"></p>
```

```
[![image](img.jpg)](url)
.
<p><a href="url"><img alt="image" src="img.jpg"></a></p>
```

```
[unclosed](hello *a
b*
.
<p>[unclosed](hello <strong>a
b</strong></p>
```

Note that soft breaks are ignored, so long URLs
can be split over multiple lines:
```
[closed](hello *a
b*)
.
<p><a href="hello *ab*">closed</a></p>
```

Here the strong takes precedence over the link because it
starts first:
```
*[closed](hello*)
.
<p><strong>[closed](hello</strong>)</p>
```

Avoid this with a backslash escape:
```
*[closed](hello\*)
.
<p>*<a href="hello*">closed</a></p>
```

Link in link?
```
[[foo](bar)](baz)
.
<p><a href="baz"><a href="bar">foo</a></a></p>
```

Link in image?
```
![[link](url)](img)
.
<p><img alt="link" src="img"></p>
```

Image in link?
```
[![image](img)](url)
.
<p><a href="url"><img alt="image" src="img"></a></p>
```

Autolinks:
```
<http://example.com/foo>
<me@example.com>
.
<p><a href="http://example.com/foo">http://example.com/foo</a>
<a href="mailto:me@example.com">me@example.com</a></p>
```

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)
.
<p><a href="x_y">x_y</a></p>
```

```
[x_y](x_
.
<p>[x_y](x_</p>
```

```
[x_y]{.bar_}
.
<p><span class="bar_">x_y</span></p>
```