git.iko.soy/typeable/pandoc
on 1.8 help sign in
typeable/pandoc/tests/writer.markdown
699 lines 9.4 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* * * * *
10# Headers
12## Level 2 with an [embedded link](/url)
14### Level 3 with *emphasis*
16#### Level 4
18##### Level 5
20# Level 1
22## Level 2 with *emphasis*
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. \* criminey.
44There should be a hard line break\
45here.
47* * * * *
49# Block Quotes
51E-mail style:
53> This is a block quote. It is pretty short.
55> Code in a block quote:
57> sub status {
58> print "working";
59> }
61> A list:
63> 1. item one
64> 2. item two
66> Nested block quotes:
68> > nested
70> > nested
72This should not be a block quote: 2 \> 1.
74And a following paragraph.
76* * * * *
78# Code Blocks
80Code:
82 ---- (should be four hyphens)
84 sub status {
85 print "working";
86 }
88 this code block is indented by one tab
90And:
92 this code block is indented by two tabs
94 These should not be escaped: \$ \\ \> \[ \{
96* * * * *
98# Lists
100## Unordered
102Asterisks tight:
104- asterisk 1
105- asterisk 2
106- asterisk 3
108Asterisks loose:
110- asterisk 1
112- asterisk 2
114- asterisk 3
116Pluses tight:
118- Plus 1
119- Plus 2
120- Plus 3
122Pluses loose:
124- Plus 1
126- Plus 2
128- Plus 3
130Minuses tight:
132- Minus 1
133- Minus 2
134- Minus 3
136Minuses loose:
138- Minus 1
140- Minus 2
142- Minus 3
144## Ordered
146Tight:
1481. First
1492. Second
1503. Third
152and:
1541. One
1552. Two
1563. Three
158Loose using tabs:
1601. First
1622. Second
1643. Third
166and using spaces:
1681. One
1702. Two
1723. Three
174Multiple paragraphs:
1761. Item 1, graf one.
178 Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.
1802. Item 2.
1823. Item 3.
184## Nested
186- Tab
187 - Tab
188 - Tab
190Here’s another:
1921. First
1932. Second:
194 - Fee
195 - Fie
196 - Foe
1983. Third
200Same thing but with paragraphs:
2021. First
2042. Second:
206 - Fee
207 - Fie
208 - Foe
2103. Third
212## Tabs and spaces
214- this is a list item indented with tabs
216- this is a list item indented with spaces
218 - this is an example list item indented with tabs
220 - this is an example list item indented with spaces
222## Fancy list markers
224(2) begins with 2
225(3) and now 3
227 with a continuation
229 iv. sublist with roman numerals, starting with 4
230 v. more items
231 (A) a subsublist
232 (B) a subsublist
234Nesting:
236A. Upper Alpha
237 I. Upper Roman.
238 (6) Decimal start with 6
239 c) Lower alpha with paren
241Autonumbering:
2431. Autonumber.
2442. More.
245 1. Nested.
247Should not be a list item:
249M.A. 2007
251B. Williams
253* * * * *
255# Definition Lists
257Tight using spaces:
259apple
260 ~ red fruit
261orange
262 ~ orange fruit
263banana
264 ~ yellow fruit
266Tight using tabs:
268apple
269 ~ red fruit
270orange
271 ~ orange fruit
272banana
273 ~ yellow fruit
275Loose:
277apple
278 ~ red fruit
280orange
281 ~ orange fruit
283banana
284 ~ yellow fruit
286Multiple blocks with italics:
288*apple*
289 ~ red fruit
291 contains seeds, crisp, pleasant to taste
293*orange*
294 ~ orange fruit
296 { orange code block }
298 > orange block quote
300Multiple definitions, tight:
302apple
303 ~ red fruit
304 ~ computer
305orange
306 ~ orange fruit
307 ~ bank
309Multiple definitions, loose:
311apple
312 ~ red fruit
314 ~ computer
316orange
317 ~ orange fruit
319 ~ bank
321Blank line after term, indented marker, alternate markers:
323apple
324 ~ red fruit
326 ~ computer
328orange
329 ~ orange fruit
331 1. sublist
332 2. sublist
334# HTML Blocks
336Simple block on one line:
338<div>
339foo
340</div>
342And nested without indentation:
344<div>
345<div>
346<div>
347foo
348</div>
349</div>
350<div>
351bar
352</div>
353</div>
355Interpreted markdown in a table:
357<table>
358<tr>
359<td>
360This is *emphasized*
361</td>
362<td>
363And this is **strong**
364</td>
365</tr>
366</table>
368<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
370Here’s a simple block:
372<div>
374foo
375</div>
377This should be a code block, though:
379 <div>
380 foo
381 </div>
383As should this:
385 <div>foo</div>
387Now, nested:
389<div>
390 <div>
391 <div>
393foo
394</div>
395 </div>
396</div>
398This should just be an HTML comment:
400<!-- Comment -->
402Multiline:
404<!--
405Blah
406Blah
407-->
409<!--
410 This is another comment.
411-->
413Code block:
415 <!-- Comment -->
417Just plain comment, with trailing spaces on the line:
419<!-- foo -->
421Code:
423 <hr />
425Hr’s:
427<hr>
429<hr />
431<hr />
433<hr>
435<hr />
437<hr />
439<hr class="foo" id="bar" />
441<hr class="foo" id="bar" />
443<hr class="foo" id="bar">
445* * * * *
447# Inline Markup
449This is *emphasized*, and so *is this*.
451This is **strong**, and so **is this**.
453An *[emphasized link](/url)*.
455***This is strong and em.***
457So is ***this*** word.
459***This is strong and em.***
461So is ***this*** word.
463This is code: `>`, `$`, `\`, `\$`, `<html>`.
465~~This is *strikeout*.~~
467Superscripts: a^bc^d a^*hello*^ a^hello there^.
469Subscripts: H~2~O, H~23~O, H~many of them~O.
471These should not be superscripts or subscripts, because of the unescaped
472spaces: a\^b c\^d, a\~b c\~d.
474* * * * *
476# Smart quotes, ellipses, dashes
478“Hello,” said the spider. “‘Shelob’ is my name.”
480‘A’, ‘B’, and ‘C’ are letters.
482‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’
484‘He said, “I want to go.”’ Were you alive in the 70’s?
486Here is some quoted ‘`code`’ and a “[quoted
487link](http://example.com/?foo=1&bar=2)”.
489Some dashes: one—two — three—four — five.
491Dashes between numbers: 5–7, 255–66, 1987–1999.
493Ellipses…and…and….
495* * * * *
497# LaTeX
499- \cite[22-23]{smith.1899}
500- $2+2=4$
501- $x \in y$
502- $\alpha \wedge \omega$
503- $223$
504- $p$-Tree
505- Here’s some display math:
506 $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
507- Here’s one that has a line break in it: $\alpha + \omega \times x^2$.
509These shouldn’t be math:
511- To get the famous equation, write `$e = mc^2$`.
512- $22,000 is a *lot* of money. So is $34,000. (It worked if “lot” is
513 emphasized.)
514- Shoes ($20) and socks ($5).
515- Escaped `$`: $73 *this should be emphasized* 23$.
517Here’s a LaTeX table:
519\begin{tabular}{|l|l|}\hline
520Animal & Number \\ \hline
521Dog & 2 \\
522Cat & 1 \\ \hline
523\end{tabular}
525* * * * *
527# Special Characters
529Here is some unicode:
531- I hat: Î
532- o umlaut: ö
533- section: §
534- set membership: ∈
535- copyright: ©
537AT&T has an ampersand in their name.
539AT&T is another way to write it.
541This & that.
5434 < 5.
5456 \> 5.
547Backslash: \\
549Backtick: \`
551Asterisk: \*
553Underscore: \_
555Left brace: {
557Right brace: }
559Left bracket: [
561Right bracket: ]
563Left paren: (
565Right paren: )
567Greater-than: \>
569Hash: \#
571Period: .
573Bang: !
575Plus: +
577Minus: -
579* * * * *
581# Links
583## Explicit
585Just a [URL](/url/).
587[URL and title](/url/ "title").
589[URL and title](/url/ "title preceded by two spaces").
591[URL and title](/url/ "title preceded by a tab").
593[URL and title](/url/ "title with "quotes" in it")
595[URL and title](/url/ "title with single quotes")
597[with\_underscore](/url/with_underscore)
599[Email link](mailto:nobody@nowhere.net)
601[Empty]().
603## Reference
605Foo [bar](/url/).
607Foo [bar](/url/).
609Foo [bar](/url/).
611With [embedded [brackets]](/url/).
613[b](/url/) by itself should be a link.
615Indented [once](/url).
617Indented [twice](/url).
619Indented [thrice](/url).
621This should [not][] be a link.
623 [not]: /url
625Foo [bar](/url/ "Title with "quotes" inside").
627Foo [biz](/url/ "Title with "quote" inside").
629## With ampersands
631Here’s a [link with an ampersand in the URL](http://example.com/?foo=1&bar=2).
633Here’s a link with an amersand in the link text:
634[AT&T](http://att.com/ "AT&T").
636Here’s an [inline link](/script?foo=1&bar=2).
638Here’s an [inline link in pointy braces](/script?foo=1&bar=2).
640## Autolinks
642With an ampersand: <http://example.com/?foo=1&bar=2>
644- In a list?
645- <http://example.com/>
646- It should.
648An e-mail address: <nobody@nowhere.net>
650> Blockquoted: <http://example.com/>
652Auto-links should not occur here: `<http://example.com/>`
654 or here: <http://example.com/>
656* * * * *
658# Images
660From “Voyage dans la Lune” by Georges Melies (1902):
662![lalune](lalune.jpg "Voyage dans la Lune")
664Here is a movie ![movie](movie.jpg) icon.
666* * * * *
668# Footnotes
670Here is a footnote reference,[^1] and another.[^2] This should *not* be a
671footnote reference, because it contains a space.[\^my note] Here is an inline
672note.[^3]
674> Notes can go in quotes.[^4]
6761. And in list items.[^5]
678This paragraph should not be part of the note, as it is not indented.
680[^1]: Here is the footnote. It can go anywhere after the footnote reference.
681 It need not be placed at the end of the document.
683[^2]: Here’s the long note. This one contains multiple blocks.
685 Subsequent blocks are indented to show that they belong to the footnote
686 (as with list items).
688 { <code> }
690 If you want, you can indent every line, but you can also be lazy and just
691 indent the first line of each block.
693[^3]: This is *easier* to type. Inline notes may contain
694 [links](http://google.com) and `]` verbatim characters, as well as
695 [bracketed text].
697[^4]: In quote.
699[^5]: In list.