'<p><a href="http://de.wikipedia.org"><img src="wikilogo.png" alt="Wikipedia"></a></p>'\
"Image Link"
+assert ' <<macro /test -- "* weird <args>" _foo_>>' '<p> <code class="macro">macro /test -- "* weird <args>" _foo_</code></p>' "Macros"
+
# Block checks
printf '\n## Testing Block markup ##\n'
assert '![Testbild](Test Bild.jpg "German Television *test* image ca. 1994")' \
'<figure data-src="Test Bild.jpg"><img src="Test Bild.jpg" alt="Testbild"><figcaption>German Television <em>test</em> image ca. 1994</figcaption></figure>' \
-"inline image"
+"block image"
assert '![Testbild *ARD*](Test Bild.jpg){tv ard function-check}' \
'<figure data-src="Test Bild.jpg" class="tv ard function-check"><img src="Test Bild.jpg" alt="Testbild *ARD*" class="tv ard function-check"></figure>' \
# 'Pipe Tables'
assert '+---+---+---+
-|Col 1| Col 2 | Col 3|
+|Col 1\\| Col\|2 | Col 3|
+===+:==:+===+
| * foo1 | *bar* |```|
| * foo2 | **qua** |code |
+-------+-----+----+
' \
'<table><thead>
-<tr><th align=""><p>Col 1</p>
-</th><th align="center"><p> Col 2 </p>
+<tr><th align=""><p>Col 1\</p>
+</th><th align="center"><p> Col|2 </p>
</th><th align=""><p> Col 3</p>
</th></tr>
</thead><tbody>
</section></section>' \
'Headline Nesting'
-printf '\nAll test passed!\n'
+# Reference syntax checks
+printf '\n## Testing reference syntax ##\n'
+
+assert 'Foo bar [Link] [1] for show
+
+The same in [en][]
+
+[en]: <http://en.wikipedia.org>
+[1]: http://de.wikipedia.org "Online Encyclopedia"' \
+'<p>Foo bar <a href="http://de.wikipedia.org" title="Online Encyclopedia">Link</a> for show</p>
+
+<p>The same in <a href="http://en.wikipedia.org">en</a></p>' \
+"Reference Links"
+
+assert 'Foo bar [Link] [1] for show
+
+[en]: <http://en.wikipedia.org>
+[1]: http://de.wikipedia.org
+ "Online Encyclopedia"' \
+'<p>Foo bar <a href="http://de.wikipedia.org" title="Online Encyclopedia">Link</a> for show</p>' \
+"Reference Links"
+
+assert 'Foo bar ![Image] [1] for show
+
+The same as ![PNG][]
+
+[PNG]: <mage/path/i.png>
+[1]: http://de.wikipedia.org/logo.jpg "Online Encyclopedia"' \
+'<p>Foo bar <img src="http://de.wikipedia.org/logo.jpg" alt="Image" title="Online Encyclopedia"> for show</p>
+
+<p>The same as <img src="mage/path/i.png" alt="PNG"></p>' \
+"Reference images"
+
+assert '![Image] [1]
+
+[PNG]: <mage/path/i.png>
+[1]: http://de.wikipedia.org/logo.jpg "Online Encyclopedia"' \
+'<figure data-src="http://de.wikipedia.org/logo.jpg"><img src="http://de.wikipedia.org/logo.jpg" alt="Image"><figcaption>Online Encyclopedia</figcaption></figure>' \
+"Reference images (block)"
+
+assert '<<macro /test -- "* weird <args>" _foo_>>' '<code class="macro">macro /test -- "* weird <args>" _foo_</code>' "Macros/Block"
+
+printf '\nAll tests passed!\n'