git.iko.soy/typeable/pandoc
on 1.5 help sign in
typeable/pandoc/tests/writer.markdown
745 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
6John Gruber's markdown test suite.
9* * * * *
11# Headers
13## Level 2 with an [embedded link](/url)
15### Level 3 with *emphasis*
17#### Level 4
19##### Level 5
21# Level 1
23## Level 2 with *emphasis*
25### Level 3
27with no blank line
29## Level 2
31with no blank line
34* * * * *
36# Paragraphs
38Here's a regular paragraph.
40In Markdown 1.0.0 and earlier. Version 8. This line turns into a
41list item. Because a hard-wrapped line in the middle of a paragraph
42looked like a list item.
44Here's one with a bullet. \* criminey.
46There should be a hard line break
47here.
50* * * * *
52# Block Quotes
54E-mail style:
56> This is a block quote. It is pretty short.
58> Code in a block quote:
59>
60> sub status {
61> print "working";
62> }
63>
64> A list:
65>
66> 1. item one
67> 2. item two
68>
69> Nested block quotes:
70>
71> > nested
72>
73> > nested
75This should not be a block quote: 2 \> 1.
77And a following paragraph.
80* * * * *
82# Code Blocks
84Code:
86 ---- (should be four hyphens)
88 sub status {
89 print "working";
90 }
92 this code block is indented by one tab
94And:
96 this code block is indented by two tabs
98 These should not be escaped: \$ \\ \> \[ \{
101* * * * *
103# Lists
105## Unordered
107Asterisks tight:
109- asterisk 1
110- asterisk 2
111- asterisk 3
113Asterisks loose:
115- asterisk 1
117- asterisk 2
119- asterisk 3
122Pluses tight:
124- Plus 1
125- Plus 2
126- Plus 3
128Pluses loose:
130- Plus 1
132- Plus 2
134- Plus 3
137Minuses tight:
139- Minus 1
140- Minus 2
141- Minus 3
143Minuses loose:
145- Minus 1
147- Minus 2
149- Minus 3
152## Ordered
154Tight:
1561. First
1572. Second
1583. Third
160and:
1621. One
1632. Two
1643. Three
166Loose using tabs:
1681. First
1702. Second
1723. Third
175and using spaces:
1771. One
1792. Two
1813. Three
184Multiple paragraphs:
1861. Item 1, graf one.
188 Item 1. graf two. The quick brown fox jumped over the lazy dog's
189 back.
1912. Item 2.
1933. Item 3.
196## Nested
198- Tab
199 - Tab
200 - Tab
204Here's another:
2061. First
2072. Second:
208 - Fee
209 - Fie
210 - Foe
2123. Third
214Same thing but with paragraphs:
2161. First
2182. Second:
220 - Fee
221 - Fie
222 - Foe
2243. Third
227## Tabs and spaces
229- this is a list item indented with tabs
231- this is a list item indented with spaces
233 - this is an example list item indented with tabs
235 - this is an example list item indented with spaces
239## Fancy list markers
241(2) begins with 2
242(3) and now 3
244 with a continuation
246 iv. sublist with roman numerals, starting with 4
247 v. more items
248 (A) a subsublist
249 (B) a subsublist
253Nesting:
255A. Upper Alpha
256 I. Upper Roman.
257 (6) Decimal start with 6
258 c) Lower alpha with paren
263Autonumbering:
2651. Autonumber.
2662. More.
267 1. Nested.
270Should not be a list item:
272M.A. 2007
274B. Williams
277* * * * *
279# Definition Lists
281Tight using spaces:
283apple
284 ~ red fruit
285orange
286 ~ orange fruit
287banana
288 ~ yellow fruit
290Tight using tabs:
292apple
293 ~ red fruit
294orange
295 ~ orange fruit
296banana
297 ~ yellow fruit
299Loose:
301apple
302 ~ red fruit
304orange
305 ~ orange fruit
307banana
308 ~ yellow fruit
311Multiple blocks with italics:
313*apple*
314 ~ red fruit
316 contains seeds, crisp, pleasant to taste
318*orange*
319 ~ orange fruit
321 { orange code block }
323 > orange block quote
326Multiple definitions, tight:
328apple
329 ~ red fruit
330 ~ computer
331orange
332 ~ orange fruit
333 ~ bank
335Multiple definitions, loose:
337apple
338 ~ red fruit
340 ~ computer
342orange
343 ~ orange fruit
345 ~ bank
348Blank line after term, indented marker, alternate markers:
350apple
351 ~ red fruit
353 ~ computer
355orange
356 ~ orange fruit
358 1. sublist
359 2. sublist
362# HTML Blocks
364Simple block on one line:
366<div>
367foo
368</div>
370And nested without indentation:
372<div>
373<div>
374<div>
375foo
376</div>
377</div>
378<div>
379bar
380</div>
381</div>
383Interpreted markdown in a table:
385<table>
386<tr>
387<td>
388This is *emphasized*
389</td>
390<td>
391And this is **strong**
392</td>
393</tr>
394</table>
396<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
398Here's a simple block:
400<div>
402foo
403</div>
405This should be a code block, though:
407 <div>
408 foo
409 </div>
411As should this:
413 <div>foo</div>
415Now, nested:
417<div>
418 <div>
419 <div>
421foo
422</div>
423 </div>
424</div>
426This should just be an HTML comment:
428<!-- Comment -->
430Multiline:
432<!--
433Blah
434Blah
435-->
437<!--
438 This is another comment.
439-->
441Code block:
443 <!-- Comment -->
445Just plain comment, with trailing spaces on the line:
447<!-- foo -->
449Code:
451 <hr />
453Hr's:
455<hr>
457<hr />
459<hr />
461<hr>
463<hr />
465<hr />
467<hr class="foo" id="bar" />
469<hr class="foo" id="bar" />
471<hr class="foo" id="bar">
474* * * * *
476# Inline Markup
478This is *emphasized*, and so *is this*.
480This is **strong**, and so **is this**.
482An *[emphasized link](/url)*.
484***This is strong and em.***
486So is ***this*** word.
488***This is strong and em.***
490So is ***this*** word.
492This is code: `>`, `$`, `\`, `\$`, `<html>`.
494~~This is *strikeout*.~~
496Superscripts: a^bc^d a^*hello*^ a^hello there^.
498Subscripts: H~2~O, H~23~O, H~many of them~O.
500These should not be superscripts or subscripts, because of the
501unescaped spaces: a\^b c\^d, a\~b c\~d.
504* * * * *
506# Smart quotes, ellipses, dashes
508"Hello," said the spider. "'Shelob' is my name."
510'A', 'B', and 'C' are letters.
512'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
514'He said, "I want to go."' Were you alive in the 70's?
516Here is some quoted '`code`' and a
517"[quoted link](http://example.com/?foo=1&bar=2)".
519Some dashes: one--two -- three--four -- five.
521Dashes between numbers: 5-7, 255-66, 1987-1999.
523Ellipses...and...and....
526* * * * *
528# LaTeX
530- \cite[22-23]{smith.1899}
531- $2+2=4$
532- $x \in y$
533- $\alpha \wedge \omega$
534- $223$
535- $p$-Tree
536- Here's some display math:
537 $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
538- Here's one that has a line break in it:
539 $\alpha + \omega \times x^2$.
541These shouldn't be math:
543- To get the famous equation, write `$e = mc^2$`.
544- $22,000 is a *lot* of money. So is $34,000. (It worked if "lot"
545 is emphasized.)
546- Shoes ($20) and socks ($5).
547- Escaped `$`: $73 *this should be emphasized* 23$.
549Here's a LaTeX table:
551\begin{tabular}{|l|l|}\hline
552Animal & Number \\ \hline
553Dog & 2 \\
554Cat & 1 \\ \hline
555\end{tabular}
558* * * * *
560# Special Characters
562Here is some unicode:
564- I hat: Î
565- o umlaut: ö
566- section: §
567- set membership: ∈
568- copyright: ©
570AT&T has an ampersand in their name.
572AT&T is another way to write it.
574This & that.
5764 < 5.
5786 \> 5.
580Backslash: \\
582Backtick: \`
584Asterisk: \*
586Underscore: \_
588Left brace: {
590Right brace: }
592Left bracket: [
594Right bracket: ]
596Left paren: (
598Right paren: )
600Greater-than: \>
602Hash: \#
604Period: .
606Bang: !
608Plus: +
610Minus: -
613* * * * *
615# Links
617## Explicit
619Just a [URL](/url/).
621[URL and title](/url/ "title").
623[URL and title](/url/ "title preceded by two spaces").
625[URL and title](/url/ "title preceded by a tab").
627[URL and title](/url/ "title with "quotes" in it")
629[URL and title](/url/ "title with single quotes")
631[with\_underscore](/url/with_underscore)
633[Email link](mailto:nobody@nowhere.net)
635[Empty]().
637## Reference
639Foo [bar](/url/).
641Foo [bar](/url/).
643Foo [bar](/url/).
645With [embedded [brackets]](/url/).
647[b](/url/) by itself should be a link.
649Indented [once](/url).
651Indented [twice](/url).
653Indented [thrice](/url).
655This should [not][] be a link.
657 [not]: /url
659Foo [bar](/url/ "Title with "quotes" inside").
661Foo [biz](/url/ "Title with "quote" inside").
663## With ampersands
665Here's a
666[link with an ampersand in the URL](http://example.com/?foo=1&bar=2).
668Here's a link with an amersand in the link text:
669[AT&T](http://att.com/ "AT&T").
671Here's an [inline link](/script?foo=1&bar=2).
673Here's an [inline link in pointy braces](/script?foo=1&bar=2).
675## Autolinks
677With an ampersand: <http://example.com/?foo=1&bar=2>
679- In a list?
680- <http://example.com/>
681- It should.
683An e-mail address: <nobody@nowhere.net>
685> Blockquoted: <http://example.com/>
687Auto-links should not occur here: `<http://example.com/>`
689 or here: <http://example.com/>
692* * * * *
694# Images
696From "Voyage dans la Lune" by Georges Melies (1902):
698![lalune](lalune.jpg "Voyage dans la Lune")
700Here is a movie ![movie](movie.jpg) icon.
703* * * * *
705# Footnotes
707Here is a footnote reference,[^1] and another.[^2] This should
708*not* be a footnote reference, because it contains a space.[\^my
709note] Here is an inline note.[^3]
711> Notes can go in quotes.[^4]
7131. And in list items.[^5]
715This paragraph should not be part of the note, as it is not
716indented.
719[^1]:
720 Here is the footnote. It can go anywhere after the footnote
721 reference. It need not be placed at the end of the document.
723[^2]:
724 Here's the long note. This one contains multiple blocks.
726 Subsequent blocks are indented to show that they belong to the
727 footnote (as with list items).
729 { <code> }
731 If you want, you can indent every line, but you can also be lazy
732 and just indent the first line of each block.
734[^3]:
735 This is *easier* to type. Inline notes may contain
736 [links](http://google.com) and `]` verbatim characters, as well as
737 [bracketed text].
739[^4]:
740 In quote.
742[^5]:
743 In list.