git.iko.soy/typeable/pandoc
on 0.10 help sign in
typeable/pandoc/tests/writer.markdown
726 lines 9.7 kB history raw
1% Pandoc Test Suite
2% John MacFarlane; Anonymous
3% July 17, 2006
5This is a set of tests for pandoc. Most of them are adapted from John Gruber’s
6markdown test suite.
8* * * * *
10Headers
11=======
13Level 2 with an [embedded link](/url)
14-------------------------------------
16### Level 3 with *emphasis*
18#### Level 4
20##### Level 5
22Level 1
23=======
25Level 2 with *emphasis*
26-----------------------
28### Level 3
30with no blank line
32Level 2
33-------
35with no blank line
37* * * * *
39Paragraphs
40==========
42Here’s a regular paragraph.
44In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
45Because a hard-wrapped line in the middle of a paragraph looked like a list
46item.
48Here’s one with a bullet. \* criminey.
50There should be a hard line break\
51here.
53* * * * *
55Block Quotes
56============
58E-mail style:
60> This is a block quote. It is pretty short.
62> Code in a block quote:
64> sub status {
65> print "working";
66> }
68> A list:
70> 1. item one
71> 2. item two
73> Nested block quotes:
75> > nested
77> > nested
79This should not be a block quote: 2 \> 1.
81And a following paragraph.
83* * * * *
85Code Blocks
86===========
88Code:
90 ---- (should be four hyphens)
92 sub status {
93 print "working";
94 }
96 this code block is indented by one tab
98And:
100 this code block is indented by two tabs
102 These should not be escaped: \$ \\ \> \[ \{
104* * * * *
106Lists
107=====
109Unordered
110---------
112Asterisks tight:
114- asterisk 1
115- asterisk 2
116- asterisk 3
118Asterisks loose:
120- asterisk 1
122- asterisk 2
124- asterisk 3
126Pluses tight:
128- Plus 1
129- Plus 2
130- Plus 3
132Pluses loose:
134- Plus 1
136- Plus 2
138- Plus 3
140Minuses tight:
142- Minus 1
143- Minus 2
144- Minus 3
146Minuses loose:
148- Minus 1
150- Minus 2
152- Minus 3
154Ordered
155-------
157Tight:
1591. First
1602. Second
1613. Third
163and:
1651. One
1662. Two
1673. Three
169Loose using tabs:
1711. First
1732. Second
1753. Third
177and using spaces:
1791. One
1812. Two
1833. Three
185Multiple paragraphs:
1871. Item 1, graf one.
189 Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.
1912. Item 2.
1933. Item 3.
195Nested
196------
198- Tab
199 - Tab
200 - Tab
202Here’s another:
2041. First
2052. Second:
206 - Fee
207 - Fie
208 - Foe
2103. Third
212Same thing but with paragraphs:
2141. First
2162. Second:
218 - Fee
219 - Fie
220 - Foe
2223. Third
224Tabs and spaces
225---------------
227- this is a list item indented with tabs
229- this is a list item indented with spaces
231 - this is an example list item indented with tabs
233 - this is an example list item indented with spaces
235Fancy list markers
236------------------
238(2) begins with 2
239(3) and now 3
241 with a continuation
243 iv. sublist with roman numerals, starting with 4
244 v. more items
245 (A) a subsublist
246 (B) a subsublist
248Nesting:
250A. Upper Alpha
251 I. Upper Roman.
252 (6) Decimal start with 6
253 c) Lower alpha with paren
255Autonumbering:
2571. Autonumber.
2582. More.
259 1. Nested.
261Should not be a list item:
263M.A. 2007
265B. Williams
267* * * * *
269Definition Lists
270================
272Tight using spaces:
274apple
275: red fruit
276orange
277: orange fruit
278banana
279: yellow fruit
281Tight using tabs:
283apple
284: red fruit
285orange
286: orange fruit
287banana
288: yellow fruit
290Loose:
292apple
293: red fruit
295orange
296: orange fruit
298banana
299: yellow fruit
301Multiple blocks with italics:
303*apple*
304: red fruit
306 contains seeds, crisp, pleasant to taste
308*orange*
309: orange fruit
311 { orange code block }
313 > orange block quote
315Multiple definitions, tight:
317apple
318: red fruit
319: computer
320orange
321: orange fruit
322: bank
324Multiple definitions, loose:
326apple
327: red fruit
329: computer
331orange
332: orange fruit
334: bank
336Blank line after term, indented marker, alternate markers:
338apple
339: red fruit
341: computer
343orange
344: orange fruit
346 1. sublist
347 2. sublist
349HTML Blocks
350===========
352Simple block on one line:
354<div>
355foo
356</div>
358And nested without indentation:
360<div>
361<div>
362<div>
363foo
364</div>
365</div>
366<div>
367bar
368</div>
369</div>
371Interpreted markdown in a table:
373<table>
374<tr>
375<td>
376This is *emphasized*
377</td>
378<td>
379And this is **strong**
380</td>
381</tr>
382</table>
384<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
386Here’s a simple block:
388<div>
390foo
391</div>
393This should be a code block, though:
395 <div>
396 foo
397 </div>
399As should this:
401 <div>foo</div>
403Now, nested:
405<div>
406 <div>
407 <div>
409foo
410</div>
411 </div>
412</div>
414This should just be an HTML comment:
416<!-- Comment -->
418Multiline:
420<!--
421Blah
422Blah
423-->
425<!--
426 This is another comment.
427-->
429Code block:
431 <!-- Comment -->
433Just plain comment, with trailing spaces on the line:
435<!-- foo -->
437Code:
439 <hr />
441Hr’s:
443<hr>
445<hr />
447<hr />
449<hr>
451<hr />
453<hr />
455<hr class="foo" id="bar" />
457<hr class="foo" id="bar" />
459<hr class="foo" id="bar">
461* * * * *
463Inline Markup
464=============
466This is *emphasized*, and so *is this*.
468This is **strong**, and so **is this**.
470An *[emphasized link](/url)*.
472***This is strong and em.***
474So is ***this*** word.
476***This is strong and em.***
478So is ***this*** word.
480This is code: `>`, `$`, `\`, `\$`, `<html>`.
482~~This is *strikeout*.~~
484Superscripts: a^bc^d a^*hello*^ a^hello there^.
486Subscripts: H~2~O, H~23~O, H~many of them~O.
488These should not be superscripts or subscripts, because of the unescaped
489spaces: a\^b c\^d, a\~b c\~d.
491* * * * *
493Smart quotes, ellipses, dashes
494==============================
496“Hello,” said the spider. “‘Shelob’ is my name.”
498‘A’, ‘B’, and ‘C’ are letters.
500‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’
502‘He said, “I want to go.”’ Were you alive in the 70’s?
504Here is some quoted ‘`code`’ and a “[quoted
505link](http://example.com/?foo=1&bar=2)”.
507Some dashes: one—two — three—four — five.
509Dashes between numbers: 5–7, 255–66, 1987–1999.
511Ellipses…and…and….
513* * * * *
515LaTeX
516=====
518- \cite[22-23]{smith.1899}
519- $2+2=4$
520- $x \in y$
521- $\alpha \wedge \omega$
522- $223$
523- $p$-Tree
524- Here’s some display math:
525 $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
526- Here’s one that has a line break in it: $\alpha + \omega \times x^2$.
528These shouldn’t be math:
530- To get the famous equation, write `$e = mc^2$`.
531- \$22,000 is a *lot* of money. So is \$34,000. (It worked if “lot” is
532 emphasized.)
533- Shoes (\$20) and socks (\$5).
534- Escaped `$`: \$73 *this should be emphasized* 23\$.
536Here’s a LaTeX table:
538\begin{tabular}{|l|l|}\hline
539Animal & Number \\ \hline
540Dog & 2 \\
541Cat & 1 \\ \hline
542\end{tabular}
544* * * * *
546Special Characters
547==================
549Here is some unicode:
551- I hat: Î
552- o umlaut: ö
553- section: §
554- set membership: ∈
555- copyright: ©
557AT&T has an ampersand in their name.
559AT&T is another way to write it.
561This & that.
5634 \< 5.
5656 \> 5.
567Backslash: \\
569Backtick: \`
571Asterisk: \*
573Underscore: \_
575Left brace: {
577Right brace: }
579Left bracket: [
581Right bracket: ]
583Left paren: (
585Right paren: )
587Greater-than: \>
589Hash: \#
591Period: .
593Bang: !
595Plus: +
597Minus: -
599* * * * *
601Links
602=====
604Explicit
605--------
607Just a [URL](/url/).
609[URL and title](/url/ "title").
611[URL and title](/url/ "title preceded by two spaces").
613[URL and title](/url/ "title preceded by a tab").
615[URL and title](/url/ "title with "quotes" in it")
617[URL and title](/url/ "title with single quotes")
619[with\_underscore](/url/with_underscore)
621[Email link](mailto:nobody@nowhere.net)
623[Empty]().
625Reference
626---------
628Foo [bar](/url/).
630Foo [bar](/url/).
632Foo [bar](/url/).
634With [embedded [brackets]](/url/).
636[b](/url/) by itself should be a link.
638Indented [once](/url).
640Indented [twice](/url).
642Indented [thrice](/url).
644This should [not][] be a link.
646 [not]: /url
648Foo [bar](/url/ "Title with "quotes" inside").
650Foo [biz](/url/ "Title with "quote" inside").
652With ampersands
653---------------
655Here’s a [link with an ampersand in the URL](http://example.com/?foo=1&bar=2).
657Here’s a link with an amersand in the link text:
658[AT&T](http://att.com/ "AT&T").
660Here’s an [inline link](/script?foo=1&bar=2).
662Here’s an [inline link in pointy braces](/script?foo=1&bar=2).
664Autolinks
665---------
667With an ampersand: <http://example.com/?foo=1&bar=2>
669- In a list?
670- <http://example.com/>
671- It should.
673An e-mail address: <nobody@nowhere.net>
675> Blockquoted: <http://example.com/>
677Auto-links should not occur here: `<http://example.com/>`
679 or here: <http://example.com/>
681* * * * *
683Images
684======
686From “Voyage dans la Lune” by Georges Melies (1902):
688![lalune](lalune.jpg "Voyage dans la Lune")
690Here is a movie ![movie](movie.jpg) icon.
692* * * * *
694Footnotes
695=========
697Here is a footnote reference,[^1] and another.[^2] This should *not* be a
698footnote reference, because it contains a space.[\^my note] Here is an inline
699note.[^3]
701> Notes can go in quotes.[^4]
7031. And in list items.[^5]
705This paragraph should not be part of the note, as it is not indented.
707[^1]: Here is the footnote. It can go anywhere after the footnote reference.
708 It need not be placed at the end of the document.
710[^2]: Here’s the long note. This one contains multiple blocks.
712 Subsequent blocks are indented to show that they belong to the footnote
713 (as with list items).
715 { <code> }
717 If you want, you can indent every line, but you can also be lazy and just
718 indent the first line of each block.
720[^3]: This is *easier* to type. Inline notes may contain
721 [links](http://google.com) and `]` verbatim characters, as well as
722 [bracketed text].
724[^4]: In quote.
726[^5]: In list.