git.iko.soy/typeable/pandoc
on 2.2.3 help sign in
typeable/pandoc/test/writer.custom
783 lines 14 kB history raw
1<p>This is a set of tests for pandoc. Most of them are adapted from
2John Gruber’s markdown test suite.</p>
4<hr/>
6<h1 id="headers">Headers</h1>
8<h2 id="level-2-with-an-embedded-link">Level 2 with an <a href='/url' title=''>embedded link</a></h2>
10<h3 id="level-3-with-emphasis">Level 3 with <em>emphasis</em></h3>
12<h4 id="level-4">Level 4</h4>
14<h5 id="level-5">Level 5</h5>
16<h1 id="level-1">Level 1</h1>
18<h2 id="level-2-with-emphasis">Level 2 with <em>emphasis</em></h2>
20<h3 id="level-3">Level 3</h3>
22<p>with no blank line</p>
24<h2 id="level-2">Level 2</h2>
26<p>with no blank line</p>
28<hr/>
30<h1 id="paragraphs">Paragraphs</h1>
32<p>Here’s a regular paragraph.</p>
34<p>In Markdown 1.0.0 and earlier. Version
358. This line turns into a list item.
36Because a hard-wrapped line in the
37middle of a paragraph looked like a
38list item.</p>
40<p>Here’s one with a bullet.
41* criminey.</p>
43<p>There should be a hard line break<br/>here.</p>
45<hr/>
47<h1 id="block-quotes">Block Quotes</h1>
49<p>E-mail style:</p>
51<blockquote>
52<p>This is a block quote.
53It is pretty short.</p>
54</blockquote>
56<blockquote>
57<p>Code in a block quote:</p>
59<pre><code>sub status {
60 print &quot;working&quot;;
61}</code></pre>
63<p>A list:</p>
65<ol>
66<li>item one</li>
67<li>item two</li>
68</ol>
70<p>Nested block quotes:</p>
72<blockquote>
73<p>nested</p>
74</blockquote>
76<blockquote>
77<p>nested</p>
78</blockquote>
79</blockquote>
81<p>This should not be a block quote: 2
82&gt; 1.</p>
84<p>And a following paragraph.</p>
86<hr/>
88<h1 id="code-blocks">Code Blocks</h1>
90<p>Code:</p>
92<pre><code>---- (should be four hyphens)
94sub status {
95 print &quot;working&quot;;
98this code block is indented by one tab</code></pre>
100<p>And:</p>
102<pre><code> this code block is indented by two tabs
104These should not be escaped: \$ \\ \&gt; \[ \{</code></pre>
106<hr/>
108<h1 id="lists">Lists</h1>
110<h2 id="unordered">Unordered</h2>
112<p>Asterisks tight:</p>
114<ul>
115<li>asterisk 1</li>
116<li>asterisk 2</li>
117<li>asterisk 3</li>
118</ul>
120<p>Asterisks loose:</p>
122<ul>
123<li><p>asterisk 1</p></li>
124<li><p>asterisk 2</p></li>
125<li><p>asterisk 3</p></li>
126</ul>
128<p>Pluses tight:</p>
130<ul>
131<li>Plus 1</li>
132<li>Plus 2</li>
133<li>Plus 3</li>
134</ul>
136<p>Pluses loose:</p>
138<ul>
139<li><p>Plus 1</p></li>
140<li><p>Plus 2</p></li>
141<li><p>Plus 3</p></li>
142</ul>
144<p>Minuses tight:</p>
146<ul>
147<li>Minus 1</li>
148<li>Minus 2</li>
149<li>Minus 3</li>
150</ul>
152<p>Minuses loose:</p>
154<ul>
155<li><p>Minus 1</p></li>
156<li><p>Minus 2</p></li>
157<li><p>Minus 3</p></li>
158</ul>
160<h2 id="ordered">Ordered</h2>
162<p>Tight:</p>
164<ol>
165<li>First</li>
166<li>Second</li>
167<li>Third</li>
168</ol>
170<p>and:</p>
172<ol>
173<li>One</li>
174<li>Two</li>
175<li>Three</li>
176</ol>
178<p>Loose using tabs:</p>
180<ol>
181<li><p>First</p></li>
182<li><p>Second</p></li>
183<li><p>Third</p></li>
184</ol>
186<p>and using spaces:</p>
188<ol>
189<li><p>One</p></li>
190<li><p>Two</p></li>
191<li><p>Three</p></li>
192</ol>
194<p>Multiple paragraphs:</p>
196<ol>
197<li><p>Item 1, graf one.</p>
199<p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s
200back.</p></li>
201<li><p>Item 2.</p></li>
202<li><p>Item 3.</p></li>
203</ol>
205<h2 id="nested">Nested</h2>
207<ul>
208<li>Tab
210<ul>
211<li>Tab
213<ul>
214<li>Tab</li>
215</ul></li>
216</ul></li>
217</ul>
219<p>Here’s another:</p>
221<ol>
222<li>First</li>
223<li>Second:
225<ul>
226<li>Fee</li>
227<li>Fie</li>
228<li>Foe</li>
229</ul></li>
230<li>Third</li>
231</ol>
233<p>Same thing but with paragraphs:</p>
235<ol>
236<li><p>First</p></li>
237<li><p>Second:</p>
239<ul>
240<li>Fee</li>
241<li>Fie</li>
242<li>Foe</li>
243</ul></li>
244<li><p>Third</p></li>
245</ol>
247<h2 id="tabs-and-spaces">Tabs and spaces</h2>
249<ul>
250<li><p>this is a list item
251indented with tabs</p></li>
252<li><p>this is a list item
253indented with spaces</p>
255<ul>
256<li><p>this is an example list item
257indented with tabs</p></li>
258<li><p>this is an example list item
259indented with spaces</p></li>
260</ul></li>
261</ul>
263<h2 id="fancy-list-markers">Fancy list markers</h2>
265<ol>
266<li>begins with 2</li>
267<li><p>and now 3</p>
269<p>with a continuation</p>
271<ol>
272<li>sublist with roman numerals,
273starting with 4</li>
274<li>more items
276<ol>
277<li>a subsublist</li>
278<li>a subsublist</li>
279</ol></li>
280</ol></li>
281</ol>
283<p>Nesting:</p>
285<ol>
286<li>Upper Alpha
288<ol>
289<li>Upper Roman.
291<ol>
292<li>Decimal start with 6
294<ol>
295<li>Lower alpha with paren</li>
296</ol></li>
297</ol></li>
298</ol></li>
299</ol>
301<p>Autonumbering:</p>
303<ol>
304<li>Autonumber.</li>
305<li>More.
307<ol>
308<li>Nested.</li>
309</ol></li>
310</ol>
312<p>Should not be a list item:</p>
314<p>M.A. 2007</p>
316<p>B. Williams</p>
318<hr/>
320<h1 id="definition-lists">Definition Lists</h1>
322<p>Tight using spaces:</p>
324<dl>
325<dt>apple</dt>
326<dd>red fruit</dd>
327<dt>orange</dt>
328<dd>orange fruit</dd>
329<dt>banana</dt>
330<dd>yellow fruit</dd>
331</dl>
333<p>Tight using tabs:</p>
335<dl>
336<dt>apple</dt>
337<dd>red fruit</dd>
338<dt>orange</dt>
339<dd>orange fruit</dd>
340<dt>banana</dt>
341<dd>yellow fruit</dd>
342</dl>
344<p>Loose:</p>
346<dl>
347<dt>apple</dt>
348<dd><p>red fruit</p></dd>
349<dt>orange</dt>
350<dd><p>orange fruit</p></dd>
351<dt>banana</dt>
352<dd><p>yellow fruit</p></dd>
353</dl>
355<p>Multiple blocks with italics:</p>
357<dl>
358<dt><em>apple</em></dt>
359<dd><p>red fruit</p>
361<p>contains seeds,
362crisp, pleasant to taste</p></dd>
363<dt><em>orange</em></dt>
364<dd><p>orange fruit</p>
366<pre><code>{ orange code block }</code></pre>
368<blockquote>
369<p>orange block quote</p>
370</blockquote></dd>
371</dl>
373<p>Multiple definitions, tight:</p>
375<dl>
376<dt>apple</dt>
377<dd>red fruit</dd>
378<dd>computer</dd>
379<dt>orange</dt>
380<dd>orange fruit</dd>
381<dd>bank</dd>
382</dl>
384<p>Multiple definitions, loose:</p>
386<dl>
387<dt>apple</dt>
388<dd><p>red fruit</p></dd>
389<dd><p>computer</p></dd>
390<dt>orange</dt>
391<dd><p>orange fruit</p></dd>
392<dd><p>bank</p></dd>
393</dl>
395<p>Blank line after term, indented marker, alternate markers:</p>
397<dl>
398<dt>apple</dt>
399<dd><p>red fruit</p></dd>
400<dd><p>computer</p></dd>
401<dt>orange</dt>
402<dd><p>orange fruit</p>
404<ol>
405<li>sublist</li>
406<li>sublist</li>
407</ol></dd>
408</dl>
410<h1 id="html-blocks">HTML Blocks</h1>
412<p>Simple block on one line:</p>
414<div>
415foo</div>
417<p>And nested without indentation:</p>
419<div>
420<div>
421<div>
422<p>foo</p></div></div>
424<div>
425bar</div></div>
427<p>Interpreted markdown in a table:</p>
429<table>
431<tr>
433<td>
435This is <em>emphasized</em>
437</td>
439<td>
441And this is <strong>strong</strong>
443</td>
445</tr>
447</table>
449<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
451<p>Here’s a simple block:</p>
453<div>
454<p>foo</p></div>
456<p>This should be a code block, though:</p>
458<pre><code>&lt;div&gt;
459 foo
460&lt;/div&gt;</code></pre>
462<p>As should this:</p>
464<pre><code>&lt;div&gt;foo&lt;/div&gt;</code></pre>
466<p>Now, nested:</p>
468<div>
469<div>
470<div>
471foo</div></div></div>
473<p>This should just be an HTML comment:</p>
475<!-- Comment -->
477<p>Multiline:</p>
479<!--
480Blah
481Blah
482-->
484<!--
485 This is another comment.
486-->
488<p>Code block:</p>
490<pre><code>&lt;!-- Comment --&gt;</code></pre>
492<p>Just plain comment, with trailing spaces on the line:</p>
494<!-- foo -->
496<p>Code:</p>
498<pre><code>&lt;hr /&gt;</code></pre>
500<p>Hr’s:</p>
502<hr>
504<hr />
506<hr />
508<hr>
510<hr />
512<hr />
514<hr class="foo" id="bar" />
516<hr class="foo" id="bar" />
518<hr class="foo" id="bar">
520<hr/>
522<h1 id="inline-markup">Inline Markup</h1>
524<p>This is <em>emphasized</em>, and so <em>is this</em>.</p>
526<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p>
528<p>An <em><a href='/url' title=''>emphasized link</a></em>.</p>
530<p><strong><em>This is strong and em.</em></strong></p>
532<p>So is <strong><em>this</em></strong> word.</p>
534<p><strong><em>This is strong and em.</em></strong></p>
536<p>So is <strong><em>this</em></strong> word.</p>
538<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\</code>, <code>\$</code>, <code>&lt;html&gt;</code>.</p>
540<p><del>This is <em>strikeout</em>.</del></p>
542<p>Superscripts: a<sup>bc</sup>d a<sup><em>hello</em></sup> a<sup>hello there</sup>.</p>
544<p>Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.</p>
546<p>These should not be superscripts or subscripts,
547because of the unescaped spaces: a^b c^d, a~b c~d.</p>
549<hr/>
551<h1 id="smart-quotes-ellipses-dashes">Smart quotes, ellipses, dashes</h1>
553<p> said the spider. </p>
555<p>, , and are letters.</p>
557<p> and are names of trees.
558So is </p>
560<p> Were you alive in the
56170’s?</p>
563<p>Here is some quoted and a .</p>
565<p>Some dashes: one—two — three—four — five.</p>
567<p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>
569<p>Ellipses…and…and….</p>
571<hr/>
573<h1 id="latex">LaTeX</h1>
575<ul>
576<li></li>
577<li>\(2+2=4\)</li>
578<li>\(x \in y\)</li>
579<li>\(\alpha \wedge \omega\)</li>
580<li>\(223\)</li>
581<li>\(p\)-Tree</li>
582<li>Here’s some display math:
583\[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]</li>
584<li>Here’s one that has a line break in it: \(\alpha + \omega \times x^2\).</li>
585</ul>
587<p>These shouldn’t be math:</p>
589<ul>
590<li>To get the famous equation, write <code>$e = mc^2$</code>.</li>
591<li>$22,000 is a <em>lot</em> of money. So is $34,000.
592(It worked if is emphasized.)</li>
593<li>Shoes ($20) and socks ($5).</li>
594<li>Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.</li>
595</ul>
597<p>Here’s a LaTeX table:</p>
601<hr/>
603<h1 id="special-characters">Special Characters</h1>
605<p>Here is some unicode:</p>
607<ul>
608<li>I hat: Î</li>
609<li>o umlaut: ö</li>
610<li>section: §</li>
611<li>set membership: ∈</li>
612<li>copyright: ©</li>
613</ul>
615<p>AT&amp;T has an ampersand in their name.</p>
617<p>AT&amp;T is another way to write it.</p>
619<p>This &amp; that.</p>
621<p>4 &lt; 5.</p>
623<p>6 &gt; 5.</p>
625<p>Backslash: \</p>
627<p>Backtick: `</p>
629<p>Asterisk: *</p>
631<p>Underscore: _</p>
633<p>Left brace: {</p>
635<p>Right brace: }</p>
637<p>Left bracket: [</p>
639<p>Right bracket: ]</p>
641<p>Left paren: (</p>
643<p>Right paren: )</p>
645<p>Greater-than: &gt;</p>
647<p>Hash: #</p>
649<p>Period: .</p>
651<p>Bang: !</p>
653<p>Plus: +</p>
655<p>Minus: -</p>
657<hr/>
659<h1 id="links">Links</h1>
661<h2 id="explicit">Explicit</h2>
663<p>Just a <a href='/url/' title=''>URL</a>.</p>
665<p><a href='/url/' title='title'>URL and title</a>.</p>
667<p><a href='/url/' title='title preceded by two spaces'>URL and title</a>.</p>
669<p><a href='/url/' title='title preceded by a tab'>URL and title</a>.</p>
671<p><a href='/url/' title='title with &quot;quotes&quot; in it'>URL and title</a></p>
673<p><a href='/url/' title='title with single quotes'>URL and title</a></p>
675<p><a href='/url/with_underscore' title=''>with_underscore</a></p>
677<p><a href='mailto:nobody@nowhere.net' title=''>Email link</a></p>
679<p><a href='' title=''>Empty</a>.</p>
681<h2 id="reference">Reference</h2>
683<p>Foo <a href='/url/' title=''>bar</a>.</p>
685<p>With <a href='/url/' title=''>embedded [brackets]</a>.</p>
687<p><a href='/url/' title=''>b</a> by itself should be a link.</p>
689<p>Indented <a href='/url' title=''>once</a>.</p>
691<p>Indented <a href='/url' title=''>twice</a>.</p>
693<p>Indented <a href='/url' title=''>thrice</a>.</p>
695<p>This should [not][] be a link.</p>
697<pre><code>[not]: /url</code></pre>
699<p>Foo <a href='/url/' title='Title with &quot;quotes&quot; inside'>bar</a>.</p>
701<p>Foo <a href='/url/' title='Title with &quot;quote&quot; inside'>biz</a>.</p>
703<h2 id="with-ampersands">With ampersands</h2>
705<p>Here’s a <a href='http://example.com/?foo=1&amp;bar=2' title=''>link with an ampersand in the URL</a>.</p>
707<p>Here’s a link with an amersand in the link text: <a href='http://att.com/' title='AT&amp;T'>AT&amp;T</a>.</p>
709<p>Here’s an <a href='/script?foo=1&amp;bar=2' title=''>inline link</a>.</p>
711<p>Here’s an <a href='/script?foo=1&amp;bar=2' title=''>inline link in pointy braces</a>.</p>
713<h2 id="autolinks">Autolinks</h2>
715<p>With an ampersand: <a href='http://example.com/?foo=1&amp;bar=2' title=''>http://example.com/?foo=1&amp;bar=2</a></p>
717<ul>
718<li>In a list?</li>
719<li><a href='http://example.com/' title=''>http://example.com/</a></li>
720<li>It should.</li>
721</ul>
723<p>An e-mail address: <a href='mailto:nobody@nowhere.net' title=''>nobody@nowhere.net</a></p>
725<blockquote>
726<p>Blockquoted: <a href='http://example.com/' title=''>http://example.com/</a></p>
727</blockquote>
729<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
731<pre><code>or here: &lt;http://example.com/&gt;</code></pre>
733<hr/>
735<h1 id="images">Images</h1>
737<p>From by Georges Melies (1902):</p>
739<div class="figure">
740<img src="lalune.jpg" title="fig:Voyage dans la Lune"/>
741<p class="caption">lalune</p>
742</div>
744<p>Here is a movie <img src='movie.jpg' title=''/> icon.</p>
746<hr/>
748<h1 id="footnotes">Footnotes</h1>
750<p>Here is a footnote reference,<a id="fnref1" href="#fn1"><sup>1</sup></a> and another.<a id="fnref2" href="#fn2"><sup>2</sup></a>
751This should <em>not</em> be a footnote reference, because it
752contains a space.[^my note] Here is an inline note.<a id="fnref3" href="#fn3"><sup>3</sup></a></p>
754<blockquote>
755<p>Notes can go in quotes.<a id="fnref4" href="#fn4"><sup>4</sup></a></p>
756</blockquote>
758<ol>
759<li>And in list items.<a id="fnref5" href="#fn5"><sup>5</sup></a></li>
760</ol>
762<p>This paragraph should not be part of the note, as it is not indented.</p>
763<ol class="footnotes">
764<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote
765reference. It need not be placed at the end of the document. <a href="#fnref1">&#8617;</a></p></li>
766<li id="fn2"><p>Here’s the long note. This one contains multiple
767blocks.</p>
769<p>Subsequent blocks are indented to show that they belong to the
770footnote (as with list items).</p>
772<pre><code> { &lt;code&gt; }</code></pre>
774<p>If you want, you can indent every line, but you can also be
775lazy and just indent the first line of each block. <a href="#fnref2">&#8617;</a></p></li>
776<li id="fn3"><p>This
777is <em>easier</em> to type. Inline notes may contain
778<a href='http://google.com' title=''>links</a> and <code>]</code> verbatim characters,
779as well as [bracketed text]. <a href="#fnref3">&#8617;</a></p></li>
780<li id="fn4"><p>In quote. <a href="#fnref4">&#8617;</a></p></li>
781<li id="fn5"><p>In list. <a href="#fnref5">&#8617;</a></p></li>
782</ol>