git.iko.soy/typeable/pandoc
on 34412cf help sign in
typeable/pandoc/test/writer.muse
772 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#headers
14** Level 2 with an [[/url][embedded link]]
16#level-2-with-an-embedded-link
18*** Level 3 with <em>emphasis</em>
20#level-3-with-emphasis
22**** Level 4
24#level-4
26***** Level 5
28#level-5
30* Level 1
32#level-1
34** Level 2 with <em>emphasis</em>
36#level-2-with-emphasis
38*** Level 3
40#level-3
41with no blank line
43** Level 2
45#level-2
46with no blank line
48----
50* Paragraphs
52#paragraphs
53Here’s a regular paragraph.
55In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
56Because a hard-wrapped line in the middle of a paragraph looked like a list
57item.
59Here’s one with a bullet. <verbatim>*</verbatim> criminey.
61There should be a hard line break<br>
62here.
64----
66* Block Quotes
68#block-quotes
69E-mail style:
71<quote>
72This is a block quote. It is pretty short.
73</quote>
75<quote>
76Code in a block quote:
78<example>
79sub status {
80 print "working";
82</example>
84A list:
861. item one
872. item two
89Nested block quotes:
91<quote>
92nested
93</quote>
95<quote>
96nested
97</quote>
98</quote>
100This should not be a block quote: 2 <verbatim>></verbatim> 1.
102And a following paragraph.
104----
106* Code Blocks
108#code-blocks
109Code:
111<example>
112---- (should be four hyphens)
114sub status {
115 print "working";
118this code block is indented by one tab
119</example>
121And:
123<example>
124 this code block is indented by two tabs
126These should not be escaped: \$ \\ \> \[ \{
127</example>
129----
131* Lists
133#lists
135** Unordered
137#unordered
138Asterisks tight:
140 - asterisk 1
141 - asterisk 2
142 - asterisk 3
144Asterisks loose:
146 - asterisk 1
147 - asterisk 2
148 - asterisk 3
150Pluses tight:
152 - Plus 1
153 - Plus 2
154 - Plus 3
156Pluses loose:
158 - Plus 1
159 - Plus 2
160 - Plus 3
162Minuses tight:
164 - Minus 1
165 - Minus 2
166 - Minus 3
168Minuses loose:
170 - Minus 1
171 - Minus 2
172 - Minus 3
174** Ordered
176#ordered
177Tight:
179 1. First
180 2. Second
181 3. Third
183and:
185 1. One
186 2. Two
187 3. Three
189Loose using tabs:
191 1. First
192 2. Second
193 3. Third
195and using spaces:
197 1. One
198 2. Two
199 3. Three
201Multiple paragraphs:
203 1. Item 1, graf one.
205 Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.
206 2. Item 2.
207 3. Item 3.
209** Nested
211#nested
212 - Tab
213 - Tab
214 - Tab
216Here’s another:
218 1. First
219 2. Second:
220 - Fee
221 - Fie
222 - Foe
223 3. Third
225Same thing but with paragraphs:
227 1. First
228 2. Second:
230 - Fee
231 - Fie
232 - Foe
233 3. Third
235** Tabs and spaces
237#tabs-and-spaces
238 - this is a list item indented with tabs
239 - this is a list item indented with spaces
241 - this is an example list item indented with tabs
242 - this is an example list item indented with spaces
244** Fancy list markers
246#fancy-list-markers
247 2. begins with 2
248 3. and now 3
250 with a continuation
252 iv. sublist with roman numerals, starting with 4
253 v. more items
254 A. a subsublist
255 B. a subsublist
257Nesting:
259 A. Upper Alpha
260 I. Upper Roman.
261 6. Decimal start with 6
262 c. Lower alpha with paren
264Autonumbering:
266 1. Autonumber.
267 2. More.
268 1. Nested.
270Should not be a list item:
272M.A. 2007
274B. Williams
276----
278* Definition Lists
280#definition-lists
281Tight using spaces:
283 apple :: red fruit
284 orange :: orange fruit
285 banana :: yellow fruit
287Tight using tabs:
289 apple :: red fruit
290 orange :: orange fruit
291 banana :: yellow fruit
293Loose:
295 apple :: red fruit
296 orange :: orange fruit
297 banana :: yellow fruit
299Multiple blocks with italics:
301 <em>apple</em> :: red fruit
303 contains seeds, crisp, pleasant to taste
304 <em>orange</em> :: orange fruit
306 <example>
307 { orange code block }
308 </example>
310 <quote>
311orange block quote
312 </quote>
314Multiple definitions, tight:
316 apple :: red fruit
317 computer
318 orange :: orange fruit
319 bank
321Multiple definitions, loose:
323 apple :: red fruit
325 computer
326 orange :: orange fruit
328 bank
330Blank line after term, indented marker, alternate markers:
332 apple :: red fruit
334 computer
335 orange :: orange fruit
337 1. sublist
338 2. sublist
340* HTML Blocks
342#html-blocks
343Simple block on one line:
345fooAnd nested without indentation:
347foo
349barInterpreted markdown in a table:
351<literal style="html">
352<table>
353</literal>
355<literal style="html">
356<tr>
357</literal>
359<literal style="html">
360<td>
361</literal>
363This is <em>emphasized</em>
365<literal style="html">
366</td>
367</literal>
369<literal style="html">
370<td>
371</literal>
373And this is <strong>strong</strong>
375<literal style="html">
376</td>
377</literal>
379<literal style="html">
380</tr>
381</literal>
383<literal style="html">
384</table>
385</literal>
387<literal style="html">
388<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
389</literal>
391Here’s a simple block:
393foo
395This should be a code block, though:
397<example>
398<div>
399 foo
400</div>
401</example>
403As should this:
405<example>
406<div>foo</div>
407</example>
409Now, nested:
411fooThis should just be an HTML comment:
413<literal style="html">
414<!-- Comment -->
415</literal>
417Multiline:
419<literal style="html">
420<!--
421Blah
422Blah
423-->
424</literal>
426<literal style="html">
427<!--
428 This is another comment.
429-->
430</literal>
432Code block:
434<example>
435<!-- Comment -->
436</example>
438Just plain comment, with trailing spaces on the line:
440<literal style="html">
441<!-- foo -->
442</literal>
444Code:
446<example>
447<hr />
448</example>
450Hr’s:
452<literal style="html">
453<hr>
454</literal>
456<literal style="html">
457<hr />
458</literal>
460<literal style="html">
461<hr />
462</literal>
464<literal style="html">
465<hr>
466</literal>
468<literal style="html">
469<hr />
470</literal>
472<literal style="html">
473<hr />
474</literal>
476<literal style="html">
477<hr class="foo" id="bar" />
478</literal>
480<literal style="html">
481<hr class="foo" id="bar" />
482</literal>
484<literal style="html">
485<hr class="foo" id="bar">
486</literal>
488----
490* Inline Markup
492#inline-markup
493This is <em>emphasized</em>, and so <em>is this</em>.
495This is <strong>strong</strong>, and so <strong>is this</strong>.
497An <em>[[/url][emphasized link]]</em>.
499<strong><em>This is strong and em.</em></strong>
501So is <strong><em>this</em></strong> word.
503<strong><em>This is strong and em.</em></strong>
505So is <strong><em>this</em></strong> word.
507This is code: <code><verbatim>></verbatim></code>, <code>$</code>,
508<code>\</code>, <code>\$</code>, <code><verbatim><html></verbatim></code>.
510<del>This is <em>strikeout</em>.</del>
512Superscripts: a<sup>bc</sup>d a<sup><em>hello</em></sup>
513a<sup>hello there</sup>.
515Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.
517These should not be superscripts or subscripts, because of the unescaped
518spaces: a^b c^d, a~b c~d.
520----
522* Smart quotes, ellipses, dashes
524#smart-quotes-ellipses-dashes
525"Hello," said the spider. "'Shelob' is my name."
527'A', 'B', and 'C' are letters.
529'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
531'He said, "I want to go."' Were you alive in the 70’s?
533Here is some quoted '<code>code</code>' and a
534"[[http://example.com/?foo=1&bar=2][quoted link]]".
536Some dashes: one—two — three—four — five.
538Dashes between numbers: 5–7, 255–66, 1987–1999.
540Ellipses…and…and….
542----
544* LaTeX
546#latex
547 - <literal style="tex">\cite[22-23]{smith.1899}</literal>
548 - 2 + 2 <verbatim>=</verbatim> 4
549 - <em>x</em> ∈ <em>y</em>
550 - <em>α</em> ∧ <em>ω</em>
551 - 223
552 - <em>p</em>-Tree
553 - Here’s some display math:
554 <verse><verbatim>$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$</verbatim></verse>
555 - Here’s one that has a line break in it:
556 <em>α</em> + <em>ω</em> × <em>x</em><sup>2</sup>.
558These shouldn’t be math:
560 - To get the famous equation, write
561 <code><verbatim>$e = mc^2$</verbatim></code>.
562 - $22,000 is a <em>lot</em> of money. So is $34,000. (It worked if "lot" is
563 emphasized.)
564 - Shoes ($20) and socks ($5).
565 - Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.
567Here’s a LaTeX table:
569<literal style="latex">
570\begin{tabular}{|l|l|}\hline
571Animal & Number \\ \hline
572Dog & 2 \\
573Cat & 1 \\ \hline
574\end{tabular}
575</literal>
577----
579* Special Characters
581#special-characters
582Here is some unicode:
584 - I hat: Î
585 - o umlaut: ö
586 - section: §
587 - set membership: ∈
588 - copyright: ©
590AT&T has an ampersand in their name.
592AT&T is another way to write it.
594This & that.
5964 <verbatim><</verbatim> 5.
5986 <verbatim>></verbatim> 5.
600Backslash: \
602Backtick: `
604Asterisk: <verbatim>*</verbatim>
606Underscore: _
608Left brace: {
610Right brace: }
612Left bracket: <verbatim>[</verbatim>
614Right bracket: <verbatim>]</verbatim>
616Left paren: (
618Right paren: )
620Greater-than: <verbatim>></verbatim>
622Hash: #
624Period: .
626Bang: !
628Plus: +
630Minus: -
632----
634* Links
636#links
638** Explicit
640#explicit
641Just a [[/url/][URL]].
643[[/url/][URL and title]].
645[[/url/][URL and title]].
647[[/url/][URL and title]].
649[[/url/][URL and title]]
651[[/url/][URL and title]]
653[[/url/with_underscore][with_underscore]]
655[[mailto:nobody@nowhere.net][Email link]]
657[[][Empty]].
659** Reference
661#reference
662Foo [[/url/][bar]].
664Foo [[/url/][bar]].
666Foo [[/url/][bar]].
668With [[/url/][embedded <verbatim>[brackets]</verbatim>]].
670[[/url/][b]] by itself should be a link.
672Indented [[/url][once]].
674Indented [[/url][twice]].
676Indented [[/url][thrice]].
678This should <verbatim>[not][]</verbatim> be a link.
680<example>
681[not]: /url
682</example>
684Foo [[/url/][bar]].
686Foo [[/url/][biz]].
688** With ampersands
690#with-ampersands
691Here’s a [[http://example.com/?foo=1&bar=2][link with an ampersand in the
692URL]].
694Here’s a link with an amersand in the link text: [[http://att.com/][AT&T]].
696Here’s an [[/script?foo=1&bar=2][inline link]].
698Here’s an [[/script?foo=1&bar=2][inline link in pointy braces]].
700** Autolinks
702#autolinks
703With an ampersand: [[http://example.com/?foo=1&bar=2]]
705 - In a list?
706 - [[http://example.com/]]
707 - It should.
709An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
711<quote>
712Blockquoted: [[http://example.com/]]
713</quote>
715Auto-links should not occur here:
716<code><verbatim><http://example.com/></verbatim></code>
718<example>
719or here: <http://example.com/>
720</example>
722----
724* Images
726#images
727From "Voyage dans la Lune" by Georges Melies (1902):
729[[lalune.jpg][Voyage dans la Lune]]
731Here is a movie [[movie.jpg][movie]] icon.
733----
735* Footnotes
737#footnotes
738Here is a footnote reference,[1] and another.[2] This should <em>not</em> be a
739footnote reference, because it contains a <verbatim>space.[^my</verbatim>
740<verbatim>note]</verbatim> Here is an inline note.[3]
742<quote>
743Notes can go in quotes.[4]
744</quote>
746 1. And in list items.[5]
748This paragraph should not be part of the note, as it is not indented.
750[1] Here is the footnote. It can go anywhere after the footnote reference. It
751 need not be placed at the end of the document.
753[2] Here’s the long note. This one contains multiple blocks.
755 Subsequent blocks are indented to show that they belong to the footnote
756 (as with list items).
758 <example>
759 { <code> }
760 </example>
762 If you want, you can indent every line, but you can also be lazy and just
763 indent the first line of each block.
765[3] This is <em>easier</em> to type. Inline notes may contain
766 [[http://google.com][links]] and <code><verbatim>]</verbatim></code>
767 verbatim characters, as well as <verbatim>[bracketed</verbatim>
768 <verbatim>text].</verbatim>
770[4] In quote.
772[5] In list.