git.iko.soy/typeable/pandoc
on 2.0.2 help sign in
typeable/pandoc/test/writer.muse
731 lines 11 kB history raw
1#author John MacFarlane
2#title Pandoc Test Suite
3#date July 17, 2006
5This is a set of tests for pandoc. Most of them are adapted from John Gruber’s
6markdown test suite.
8----
10* Headers
12** Level 2 with an [[/url][embedded link]]
14*** Level 3 with <em>emphasis</em>
16**** Level 4
18***** Level 5
20* Level 1
22** Level 2 with <em>emphasis</em>
24*** Level 3
26with no blank line
28** Level 2
30with no blank line
32----
34* Paragraphs
36Here’s a regular paragraph.
38In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
39Because a hard-wrapped line in the middle of a paragraph looked like a list
40item.
42Here’s one with a bullet. <verbatim>*</verbatim> criminey.
44There should be a hard line break<br>
45here.
47----
49* Block Quotes
51E-mail style:
53<quote>
54This is a block quote. It is pretty short.
55</quote>
57<quote>
58Code in a block quote:
60<example>
61sub status {
62 print "working";
64</example>
66A list:
68 1. item one
69 2. item two
71Nested block quotes:
73<quote>
74nested
75</quote>
77<quote>
78nested
79</quote>
80</quote>
82This should not be a block quote: 2 <verbatim>></verbatim> 1.
84And a following paragraph.
86----
88* Code Blocks
90Code:
92<example>
93---- (should be four hyphens)
95sub status {
96 print "working";
99this code block is indented by one tab
100</example>
102And:
104<example>
105 this code block is indented by two tabs
107These should not be escaped: \$ \\ \> \[ \{
108</example>
110----
112* Lists
114** Unordered
116Asterisks tight:
118 - asterisk 1
119 - asterisk 2
120 - asterisk 3
122Asterisks loose:
124 - asterisk 1
125 - asterisk 2
126 - asterisk 3
128Pluses tight:
130 - Plus 1
131 - Plus 2
132 - Plus 3
134Pluses loose:
136 - Plus 1
137 - Plus 2
138 - Plus 3
140Minuses tight:
142 - Minus 1
143 - Minus 2
144 - Minus 3
146Minuses loose:
148 - Minus 1
149 - Minus 2
150 - Minus 3
152** Ordered
154Tight:
156 1. First
157 2. Second
158 3. Third
160and:
162 1. One
163 2. Two
164 3. Three
166Loose using tabs:
168 1. First
169 2. Second
170 3. Third
172and using spaces:
174 1. One
175 2. Two
176 3. Three
178Multiple paragraphs:
180 1. Item 1, graf one.
182 Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.
183 2. Item 2.
184 3. Item 3.
186** Nested
188 - Tab
189 - Tab
190 - Tab
192Here’s another:
194 1. First
195 2. Second:
196 - Fee
197 - Fie
198 - Foe
199 3. Third
201Same thing but with paragraphs:
203 1. First
204 2. Second:
206 - Fee
207 - Fie
208 - Foe
209 3. Third
211** Tabs and spaces
213 - this is a list item indented with tabs
214 - this is a list item indented with spaces
216 - this is an example list item indented with tabs
217 - this is an example list item indented with spaces
219** Fancy list markers
221 2. begins with 2
222 3. and now 3
224 with a continuation
226 iv. sublist with roman numerals, starting with 4
227 v. more items
228 A. a subsublist
229 B. a subsublist
231Nesting:
233 A. Upper Alpha
234 I. Upper Roman.
235 6. Decimal start with 6
236 c. Lower alpha with paren
238Autonumbering:
240 1. Autonumber.
241 2. More.
242 1. Nested.
244Should not be a list item:
246M.A. 2007
248B. Williams
250----
252* Definition Lists
254Tight using spaces:
256 apple :: red fruit
257 orange :: orange fruit
258 banana :: yellow fruit
260Tight using tabs:
262 apple :: red fruit
263 orange :: orange fruit
264 banana :: yellow fruit
266Loose:
268 apple :: red fruit
269 orange :: orange fruit
270 banana :: yellow fruit
272Multiple blocks with italics:
274 <em>apple</em> :: red fruit
276 contains seeds, crisp, pleasant to taste
277 <em>orange</em> :: orange fruit
279 <example>
280 { orange code block }
281 </example>
283 <quote>
284 orange block quote
285 </quote>
287Multiple definitions, tight:
289 apple :: red fruit
290 computer
291 orange :: orange fruit
292 bank
294Multiple definitions, loose:
296 apple :: red fruit
298 computer
299 orange :: orange fruit
301 bank
303Blank line after term, indented marker, alternate markers:
305 apple :: red fruit
307 computer
308 orange :: orange fruit
310 1. sublist
311 2. sublist
313* HTML Blocks
315Simple block on one line:
317foo
318And nested without indentation:
320foo
322bar
323Interpreted markdown in a table:
325<literal style="html">
326<table>
327</literal>
329<literal style="html">
330<tr>
331</literal>
333<literal style="html">
334<td>
335</literal>
337This is <em>emphasized</em>
339<literal style="html">
340</td>
341</literal>
343<literal style="html">
344<td>
345</literal>
347And this is <strong>strong</strong>
349<literal style="html">
350</td>
351</literal>
353<literal style="html">
354</tr>
355</literal>
357<literal style="html">
358</table>
359</literal>
361<literal style="html">
362<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
363</literal>
365Here’s a simple block:
367foo
369This should be a code block, though:
371<example>
372<div>
373 foo
374</div>
375</example>
377As should this:
379<example>
380<div>foo</div>
381</example>
383Now, nested:
385foo
386This should just be an HTML comment:
388<literal style="html">
389<!-- Comment -->
390</literal>
392Multiline:
394<literal style="html">
395<!--
396Blah
397Blah
398-->
399</literal>
401<literal style="html">
402<!--
403 This is another comment.
404-->
405</literal>
407Code block:
409<example>
410<!-- Comment -->
411</example>
413Just plain comment, with trailing spaces on the line:
415<literal style="html">
416<!-- foo -->
417</literal>
419Code:
421<example>
422<hr />
423</example>
425Hr’s:
427<literal style="html">
428<hr>
429</literal>
431<literal style="html">
432<hr />
433</literal>
435<literal style="html">
436<hr />
437</literal>
439<literal style="html">
440<hr>
441</literal>
443<literal style="html">
444<hr />
445</literal>
447<literal style="html">
448<hr />
449</literal>
451<literal style="html">
452<hr class="foo" id="bar" />
453</literal>
455<literal style="html">
456<hr class="foo" id="bar" />
457</literal>
459<literal style="html">
460<hr class="foo" id="bar">
461</literal>
463----
465* Inline Markup
467This is <em>emphasized</em>, and so <em>is this</em>.
469This is <strong>strong</strong>, and so <strong>is this</strong>.
471An <em>[[/url][emphasized link]]</em>.
473<strong><em>This is strong and em.</em></strong>
475So is <strong><em>this</em></strong> word.
477<strong><em>This is strong and em.</em></strong>
479So is <strong><em>this</em></strong> word.
481This is code: <code><verbatim>></verbatim></code>, <code>$</code>,
482<code>\</code>, <code>\$</code>, <code><verbatim><html></verbatim></code>.
484<del>This is <em>strikeout</em>.</del>
486Superscripts: a<sup>bc</sup>d a<sup><em>hello</em></sup>
487a<sup>hello there</sup>.
489Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.
491These should not be superscripts or subscripts, because of the unescaped
492spaces: a^b c^d, a~b c~d.
494----
496* Smart quotes, ellipses, dashes
498"Hello," said the spider. "'Shelob' is my name."
500'A', 'B', and 'C' are letters.
502'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
504'He said, "I want to go."' Were you alive in the 70’s?
506Here is some quoted '<code>code</code>' and a
507"[[http://example.com/?foo=1&bar=2][quoted link]]".
509Some dashes: one—two — three—four — five.
511Dashes between numbers: 5–7, 255–66, 1987–1999.
513Ellipses…and…and….
515----
517* LaTeX
519 - <literal style="tex">\cite[22-23]{smith.1899}</literal>
520 - 2 + 2 <verbatim>=</verbatim> 4
521 - <em>x</em> ∈ <em>y</em>
522 - <em>α</em> ∧ <em>ω</em>
523 - 223
524 - <em>p</em>-Tree
525 - Here’s some display math:
526 <verse><verbatim>$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$</verbatim></verse>
527 - Here’s one that has a line break in it:
528 <em>α</em> + <em>ω</em> × <em>x</em><sup>2</sup>.
530These shouldn’t be math:
532 - To get the famous equation, write
533 <code><verbatim>$e = mc^2$</verbatim></code>.
534 - $22,000 is a <em>lot</em> of money. So is $34,000. (It worked if "lot" is
535 emphasized.)
536 - Shoes ($20) and socks ($5).
537 - Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.
539Here’s a LaTeX table:
541<literal style="latex">
542\begin{tabular}{|l|l|}\hline
543Animal & Number \\ \hline
544Dog & 2 \\
545Cat & 1 \\ \hline
546\end{tabular}
547</literal>
549----
551* Special Characters
553Here is some unicode:
555 - I hat: Î
556 - o umlaut: ö
557 - section: §
558 - set membership: ∈
559 - copyright: ©
561AT&T has an ampersand in their name.
563AT&T is another way to write it.
565This & that.
5674 <verbatim><</verbatim> 5.
5696 <verbatim>></verbatim> 5.
571Backslash: \
573Backtick: `
575Asterisk: <verbatim>*</verbatim>
577Underscore: _
579Left brace: {
581Right brace: }
583Left bracket: <verbatim>[</verbatim>
585Right bracket: <verbatim>]</verbatim>
587Left paren: (
589Right paren: )
591Greater-than: <verbatim>></verbatim>
593Hash: #
595Period: .
597Bang: !
599Plus: +
601Minus: -
603----
605* Links
607** Explicit
609Just a [[/url/][URL]].
611[[/url/][URL and title]].
613[[/url/][URL and title]].
615[[/url/][URL and title]].
617[[/url/][URL and title]]
619[[/url/][URL and title]]
621[[/url/with_underscore][with_underscore]]
623[[mailto:nobody@nowhere.net][Email link]]
625[[][Empty]].
627** Reference
629Foo [[/url/][bar]].
631With [[/url/][embedded <verbatim>[brackets]</verbatim>]].
633[[/url/][b]] by itself should be a link.
635Indented [[/url][once]].
637Indented [[/url][twice]].
639Indented [[/url][thrice]].
641This should <verbatim>[not][]</verbatim> be a link.
643<example>
644[not]: /url
645</example>
647Foo [[/url/][bar]].
649Foo [[/url/][biz]].
651** With ampersands
653Here’s a [[http://example.com/?foo=1&bar=2][link with an ampersand in the
654URL]].
656Here’s a link with an amersand in the link text: [[http://att.com/][AT&T]].
658Here’s an [[/script?foo=1&bar=2][inline link]].
660Here’s an [[/script?foo=1&bar=2][inline link in pointy braces]].
662** Autolinks
664With an ampersand: [[http://example.com/?foo=1&bar=2]]
666 - In a list?
667 - [[http://example.com/]]
668 - It should.
670An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
672<quote>
673Blockquoted: [[http://example.com/]]
674</quote>
676Auto-links should not occur here:
677<code><verbatim><http://example.com/></verbatim></code>
679<example>
680or here: <http://example.com/>
681</example>
683----
685* Images
687From "Voyage dans la Lune" by Georges Melies (1902):
689[[lalune.jpg][Voyage dans la Lune]]
691Here is a movie [[movie.jpg][movie]] icon.
693----
695* Footnotes
697Here is a footnote reference,[1] and another.[2] This should <em>not</em> be a
698footnote reference, because it contains a <verbatim>space.[^my</verbatim>
699<verbatim>note]</verbatim> Here is an inline note.[3]
701<quote>
702Notes can go in quotes.[4]
703</quote>
705 1. And in list items.[5]
707This paragraph should not be part of the note, as it is not indented.
709[1] Here is the footnote. It can go anywhere after the footnote reference. It
710 need not be placed at the end of the document.
712[2] Here’s the long note. This one contains multiple blocks.
714 Subsequent blocks are indented to show that they belong to the footnote
715 (as with list items).
717 <example>
718 { <code> }
719 </example>
721 If you want, you can indent every line, but you can also be lazy and just
722 indent the first line of each block.
724[3] This is <em>easier</em> to type. Inline notes may contain
725 [[http://google.com][links]] and <code><verbatim>]</verbatim></code>
726 verbatim characters, as well as <verbatim>[bracketed</verbatim>
727 <verbatim>text].</verbatim>
729[4] In quote.
731[5] In list.