SGML

Markdown Reference Link Examples

backward-link0
Basic reference link example
forward-link5
Reference link example where the definition of a link target comes after it's use
forward-link12
Reference links to undefined or invalidly defined link targets get rendered verbatim
forward-link11
Demonstrates name-mangling of link targets in reference links

backward-link0

In this file we first define a reference link:

[link]: http://bla.bla "Title of link"

then we reference [it][link].

Rendered HTML

<p>In this file we first define a reference link:
</p><p>then we reference <a href="http://bla.bla" title="Title of link">it</a>.
</p>

forward-link5

In this file we first use a [forward link][forwardlink],
then we define it.

Unlike forward-link4.txt, the link definition doesn't contain
a title (to check handling if getline runs into EOF).

[forwardlink]: http://bla.bla

Rendered HTML

<p>In this file we first use a <a href="http://bla.bla" title="">forward link</a>,
then we define it.
</p><p>Unlike forward-link4.txt, the link definition doesn't contain
a title (to check handling if getline runs into EOF).
</p>

forward-link12

This is an [*undefined* link].

This tests that fallback text with markdown syntax is preserved
on undefined links.

Rendered HTML

<p>This is an [<em>undefined</em> link].
</p><p>This tests that fallback text with markdown syntax is preserved
on undefined links.
</p>

forward-link11

This tests basic name mangling of link ids
used in [forward links][forward links].

This tests the same for short links: [forward links].

This paragraph is used to force-flush the previous paragraph.

[forward-links]: http://forward.link
   "This is the forward link"

Rendered HTML

<p>This tests basic name mangling of link ids
used in <a href="http://forward.link" title="This is the forward link">forward links</a>.
</p><p>This tests the same for short links: <a href="http://forward.link" title="This is the forward link">forward links</a>.
</p><p>This paragraph is used to force-flush the previous paragraph.
</p>