git.iko.soy/typeable/pandoc
on 1.15.2.1 help sign in
834 lines 11 kB history raw
1#+TITLE: Pandoc Test Suite
3#+AUTHOR: John MacFarlane; Anonymous
4#+DATE: July 17, 2006
6This is a set of tests for pandoc. Most of them are adapted from John Gruber's
7markdown test suite.
9--------------
11* Headers
13** Level 2 with an [[/url][embedded link]]
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
33--------------
35* Paragraphs
37Here's a regular paragraph.
39In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
40Because a hard-wrapped line in the middle of a paragraph looked like a list
41item.
43Here's one with a bullet. * criminey.
45There should be a hard line break\\
46here.
48--------------
50* Block Quotes
52E-mail style:
54#+BEGIN_QUOTE
55 This is a block quote. It is pretty short.
56#+END_QUOTE
58#+BEGIN_QUOTE
59 Code in a block quote:
61 #+BEGIN_EXAMPLE
62 sub status {
63 print "working";
64 }
65 #+END_EXAMPLE
67 A list:
69 1. item one
70 2. item two
72 Nested block quotes:
74 #+BEGIN_QUOTE
75 nested
76 #+END_QUOTE
78 #+BEGIN_QUOTE
79 nested
80 #+END_QUOTE
81#+END_QUOTE
83This should not be a block quote: 2 > 1.
85And a following paragraph.
87--------------
89* Code Blocks
91Code:
93#+BEGIN_EXAMPLE
94 ---- (should be four hyphens)
96 sub status {
97 print "working";
98 }
100 this code block is indented by one tab
101#+END_EXAMPLE
103And:
105#+BEGIN_EXAMPLE
106 this code block is indented by two tabs
108 These should not be escaped: \$ \\ \> \[ \{
109#+END_EXAMPLE
111--------------
113* Lists
115** Unordered
117Asterisks tight:
119- asterisk 1
120- asterisk 2
121- asterisk 3
123Asterisks loose:
125- asterisk 1
127- asterisk 2
129- asterisk 3
131Pluses tight:
133- Plus 1
134- Plus 2
135- Plus 3
137Pluses loose:
139- Plus 1
141- Plus 2
143- Plus 3
145Minuses tight:
147- Minus 1
148- Minus 2
149- Minus 3
151Minuses loose:
153- Minus 1
155- Minus 2
157- Minus 3
159** Ordered
161Tight:
1631. First
1642. Second
1653. Third
167and:
1691. One
1702. Two
1713. Three
173Loose using tabs:
1751. First
1772. Second
1793. Third
181and using spaces:
1831. One
1852. Two
1873. Three
189Multiple paragraphs:
1911. Item 1, graf one.
193 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
1952. Item 2.
1973. Item 3.
199** Nested
201- Tab
203 - Tab
205 - Tab
207Here's another:
2091. First
2102. Second:
212 - Fee
213 - Fie
214 - Foe
2163. Third
218Same thing but with paragraphs:
2201. First
2222. Second:
224 - Fee
225 - Fie
226 - Foe
2283. Third
230** Tabs and spaces
232- this is a list item indented with tabs
234- this is a list item indented with spaces
236 - this is an example list item indented with tabs
238 - this is an example list item indented with spaces
240** Fancy list markers
2422) begins with 2
2433) and now 3
245 with a continuation
247 4. sublist with roman numerals, starting with 4
248 5. more items
250 1) a subsublist
251 2) a subsublist
253Nesting:
2551. Upper Alpha
257 1. Upper Roman.
259 6) Decimal start with 6
261 3) Lower alpha with paren
263Autonumbering:
2651. Autonumber.
2662. More.
268 1. Nested.
270Should not be a list item:
272M.A. 2007
274B. Williams
276--------------
278* Definition Lists
280Tight using spaces:
282- apple :: red fruit
283- orange :: orange fruit
284- banana :: yellow fruit
286Tight using tabs:
288- apple :: red fruit
289- orange :: orange fruit
290- banana :: yellow fruit
292Loose:
294- apple :: red fruit
296- orange :: orange fruit
298- banana :: yellow fruit
300Multiple blocks with italics:
302- /apple/ :: red fruit
304 contains seeds, crisp, pleasant to taste
306- /orange/ :: orange fruit
308 #+BEGIN_EXAMPLE
309 { orange code block }
310 #+END_EXAMPLE
312 #+BEGIN_QUOTE
313 orange block quote
314 #+END_QUOTE
316Multiple definitions, tight:
318- apple :: red fruit
319 computer
320- orange :: orange fruit
321 bank
323Multiple definitions, loose:
325- apple :: red fruit
327 computer
329- orange :: orange fruit
331 bank
333Blank line after term, indented marker, alternate markers:
335- apple :: red fruit
337 computer
339- orange :: orange fruit
341 1. sublist
342 2. sublist
344* HTML Blocks
346Simple block on one line:
348#+BEGIN_HTML
349 <div>
350#+END_HTML
352foo
354#+BEGIN_HTML
355 </div>
356#+END_HTML
358And nested without indentation:
360#+BEGIN_HTML
361 <div>
362#+END_HTML
364#+BEGIN_HTML
365 <div>
366#+END_HTML
368#+BEGIN_HTML
369 <div>
370#+END_HTML
372foo
374#+BEGIN_HTML
375 </div>
376#+END_HTML
378#+BEGIN_HTML
379 </div>
380#+END_HTML
382#+BEGIN_HTML
383 <div>
384#+END_HTML
386bar
388#+BEGIN_HTML
389 </div>
390#+END_HTML
392#+BEGIN_HTML
393 </div>
394#+END_HTML
396Interpreted markdown in a table:
398#+BEGIN_HTML
399 <table>
400#+END_HTML
402#+BEGIN_HTML
403 <tr>
404#+END_HTML
406#+BEGIN_HTML
407 <td>
408#+END_HTML
410This is /emphasized/
412#+BEGIN_HTML
413 </td>
414#+END_HTML
416#+BEGIN_HTML
417 <td>
418#+END_HTML
420And this is *strong*
422#+BEGIN_HTML
423 </td>
424#+END_HTML
426#+BEGIN_HTML
427 </tr>
428#+END_HTML
430#+BEGIN_HTML
431 </table>
432#+END_HTML
434#+BEGIN_HTML
435 <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
436#+END_HTML
438Here's a simple block:
440#+BEGIN_HTML
441 <div>
442#+END_HTML
444foo
446#+BEGIN_HTML
447 </div>
448#+END_HTML
450This should be a code block, though:
452#+BEGIN_EXAMPLE
453 <div>
454 foo
455 </div>
456#+END_EXAMPLE
458As should this:
460#+BEGIN_EXAMPLE
461 <div>foo</div>
462#+END_EXAMPLE
464Now, nested:
466#+BEGIN_HTML
467 <div>
468#+END_HTML
470#+BEGIN_HTML
471 <div>
472#+END_HTML
474#+BEGIN_HTML
475 <div>
476#+END_HTML
478foo
480#+BEGIN_HTML
481 </div>
482#+END_HTML
484#+BEGIN_HTML
485 </div>
486#+END_HTML
488#+BEGIN_HTML
489 </div>
490#+END_HTML
492This should just be an HTML comment:
494#+BEGIN_HTML
495 <!-- Comment -->
496#+END_HTML
498Multiline:
500#+BEGIN_HTML
501 <!--
502 Blah
503 Blah
504 -->
505#+END_HTML
507#+BEGIN_HTML
508 <!--
509 This is another comment.
510 -->
511#+END_HTML
513Code block:
515#+BEGIN_EXAMPLE
516 <!-- Comment -->
517#+END_EXAMPLE
519Just plain comment, with trailing spaces on the line:
521#+BEGIN_HTML
522 <!-- foo -->
523#+END_HTML
525Code:
527#+BEGIN_EXAMPLE
528 <hr />
529#+END_EXAMPLE
531Hr's:
533#+BEGIN_HTML
534 <hr>
535#+END_HTML
537#+BEGIN_HTML
538 <hr />
539#+END_HTML
541#+BEGIN_HTML
542 <hr />
543#+END_HTML
545#+BEGIN_HTML
546 <hr>
547#+END_HTML
549#+BEGIN_HTML
550 <hr />
551#+END_HTML
553#+BEGIN_HTML
554 <hr />
555#+END_HTML
557#+BEGIN_HTML
558 <hr class="foo" id="bar" />
559#+END_HTML
561#+BEGIN_HTML
562 <hr class="foo" id="bar" />
563#+END_HTML
565#+BEGIN_HTML
566 <hr class="foo" id="bar">
567#+END_HTML
569--------------
571* Inline Markup
573This is /emphasized/, and so /is this/.
575This is *strong*, and so *is this*.
577An /[[/url][emphasized link]]/.
579*/This is strong and em./*
581So is */this/* word.
583*/This is strong and em./*
585So is */this/* word.
587This is code: =>=, =$=, =\=, =\$=, =<html>=.
589+This is /strikeout/.+
591Superscripts: a^{bc}d a^{/hello/} a^{hello there}.
593Subscripts: H_{2}O, H_{23}O, H_{many of them}O.
595These should not be superscripts or subscripts, because of the unescaped
596spaces: a\^b c\^d, a~b c~d.
598--------------
600* Smart quotes, ellipses, dashes
602"Hello," said the spider. "'Shelob' is my name."
604'A', 'B', and 'C' are letters.
606'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
608'He said, "I want to go."' Were you alive in the 70's?
610Here is some quoted '=code=' and a "[[http://example.com/?foo=1&bar=2][quoted
611link]]".
613Some dashes: one---two --- three---four --- five.
615Dashes between numbers: 5--7, 255--66, 1987--1999.
617Ellipses...and...and....
619--------------
621* LaTeX
623- \cite[22-23]{smith.1899}
624- $2+2=4$
625- $x \in y$
626- $\alpha \wedge \omega$
627- $223$
628- $p$-Tree
629- Here's some display math:
630 $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
631- Here's one that has a line break in it: $\alpha + \omega \times x^2$.
633These shouldn't be math:
635- To get the famous equation, write =$e = mc^2$=.
636- $22,000 is a /lot/ of money. So is $34,000. (It worked if "lot" is
637 emphasized.)
638- Shoes ($20) and socks ($5).
639- Escaped =$=: $73 /this should be emphasized/ 23$.
641Here's a LaTeX table:
643\begin{tabular}{|l|l|}\hline
644Animal & Number \\ \hline
645Dog & 2 \\
646Cat & 1 \\ \hline
647\end{tabular}
649--------------
651* Special Characters
653Here is some unicode:
655- I hat: Î
656- o umlaut: ö
657- section: §
658- set membership: ∈
659- copyright: ©
661AT&T has an ampersand in their name.
663AT&T is another way to write it.
665This & that.
6674 < 5.
6696 > 5.
671Backslash: \
673Backtick: `
675Asterisk: *
677Underscore: \_
679Left brace: {
681Right brace: }
683Left bracket: [
685Right bracket: ]
687Left paren: (
689Right paren: )
691Greater-than: >
693Hash: #
695Period: .
697Bang: !
699Plus: +
701Minus: -
703--------------
705* Links
707** Explicit
709Just a [[/url/][URL]].
711[[/url/][URL and title]].
713[[/url/][URL and title]].
715[[/url/][URL and title]].
717[[/url/][URL and title]]
719[[/url/][URL and title]]
721[[/url/with_underscore][with\_underscore]]
723[[mailto:nobody@nowhere.net][Email link]]
725[[][Empty]].
727** Reference
729Foo [[/url/][bar]].
731Foo [[/url/][bar]].
733Foo [[/url/][bar]].
735With [[/url/][embedded [brackets]]].
737[[/url/][b]] by itself should be a link.
739Indented [[/url][once]].
741Indented [[/url][twice]].
743Indented [[/url][thrice]].
745This should [not][] be a link.
747#+BEGIN_EXAMPLE
748 [not]: /url
749#+END_EXAMPLE
751Foo [[/url/][bar]].
753Foo [[/url/][biz]].
755** With ampersands
757Here's a [[http://example.com/?foo=1&bar=2][link with an ampersand in the
758URL]].
760Here's a link with an amersand in the link text: [[http://att.com/][AT&T]].
762Here's an [[/script?foo=1&bar=2][inline link]].
764Here's an [[/script?foo=1&bar=2][inline link in pointy braces]].
766** Autolinks
768With an ampersand: [[http://example.com/?foo=1&bar=2]]
770- In a list?
771- [[http://example.com/]]
772- It should.
774An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
776#+BEGIN_QUOTE
777 Blockquoted: [[http://example.com/]]
778#+END_QUOTE
780Auto-links should not occur here: =<http://example.com/>=
782#+BEGIN_EXAMPLE
783 or here: <http://example.com/>
784#+END_EXAMPLE
786--------------
788* Images
790From "Voyage dans la Lune" by Georges Melies (1902):
792#+CAPTION: lalune
794[[lalune.jpg]]
795Here is a movie [[movie.jpg]] icon.
797--------------
799* Footnotes
801Here is a footnote reference, [1] and another. [2] This should /not/ be a
802footnote reference, because it contains a space.[\^my note] Here is an inline
803note. [3]
805#+BEGIN_QUOTE
806 Notes can go in quotes. [4]
807#+END_QUOTE
8091. And in list items. [5]
811This paragraph should not be part of the note, as it is not indented.
813[1] Here is the footnote. It can go anywhere after the footnote reference. It
814 need not be placed at the end of the document.
816[2] Here's the long note. This one contains multiple blocks.
818 Subsequent blocks are indented to show that they belong to the footnote
819 (as with list items).
821 #+BEGIN_EXAMPLE
822 { <code> }
823 #+END_EXAMPLE
825 If you want, you can indent every line, but you can also be lazy and just
826 indent the first line of each block.
828[3] This is /easier/ to type. Inline notes may contain
829 [[http://google.com][links]] and =]= verbatim characters, as well as
830 [bracketed text].
832[4] In quote.
834[5] In list.