git.iko.soy/typeable/pandoc
on rc/test4 help sign in
typeable/pandoc/test/writer.org
825 lines 12 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
12 :PROPERTIES:
13 :CUSTOM_ID: headers
14 :END:
15** Level 2 with an [[/url][embedded link]]
16 :PROPERTIES:
17 :CUSTOM_ID: level-2-with-an-embedded-link
18 :END:
19*** Level 3 with /emphasis/
20 :PROPERTIES:
21 :CUSTOM_ID: level-3-with-emphasis
22 :END:
23**** Level 4
24 :PROPERTIES:
25 :CUSTOM_ID: level-4
26 :END:
27***** Level 5
28 :PROPERTIES:
29 :CUSTOM_ID: level-5
30 :END:
31* Level 1
32 :PROPERTIES:
33 :CUSTOM_ID: level-1
34 :END:
35** Level 2 with /emphasis/
36 :PROPERTIES:
37 :CUSTOM_ID: level-2-with-emphasis
38 :END:
39*** Level 3
40 :PROPERTIES:
41 :CUSTOM_ID: level-3
42 :END:
43with no blank line
45** Level 2
46 :PROPERTIES:
47 :CUSTOM_ID: level-2
48 :END:
49with no blank line
51--------------
53* Paragraphs
54 :PROPERTIES:
55 :CUSTOM_ID: paragraphs
56 :END:
57Here's a regular paragraph.
59In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
60Because a hard-wrapped line in the middle of a paragraph looked like a list
61item.
63Here's one with a bullet. * criminey.
65There should be a hard line break\\
66here.
68--------------
70* Block Quotes
71 :PROPERTIES:
72 :CUSTOM_ID: block-quotes
73 :END:
74E-mail style:
76#+BEGIN_QUOTE
77 This is a block quote. It is pretty short.
78#+END_QUOTE
80#+BEGIN_QUOTE
81 Code in a block quote:
83 #+BEGIN_EXAMPLE
84 sub status {
85 print "working";
86 }
87 #+END_EXAMPLE
89 A list:
91 1. item one
92 2. item two
94 Nested block quotes:
96 #+BEGIN_QUOTE
97 nested
98 #+END_QUOTE
100 #+BEGIN_QUOTE
101 nested
102 #+END_QUOTE
103#+END_QUOTE
105This should not be a block quote: 2 > 1.
107And a following paragraph.
109--------------
111* Code Blocks
112 :PROPERTIES:
113 :CUSTOM_ID: code-blocks
114 :END:
115Code:
117#+BEGIN_EXAMPLE
118 ---- (should be four hyphens)
120 sub status {
121 print "working";
122 }
124 this code block is indented by one tab
125#+END_EXAMPLE
127And:
129#+BEGIN_EXAMPLE
130 this code block is indented by two tabs
132 These should not be escaped: \$ \\ \> \[ \{
133#+END_EXAMPLE
135--------------
137* Lists
138 :PROPERTIES:
139 :CUSTOM_ID: lists
140 :END:
141** Unordered
142 :PROPERTIES:
143 :CUSTOM_ID: unordered
144 :END:
145Asterisks tight:
147- asterisk 1
148- asterisk 2
149- asterisk 3
151Asterisks loose:
153- asterisk 1
155- asterisk 2
157- asterisk 3
159Pluses tight:
161- Plus 1
162- Plus 2
163- Plus 3
165Pluses loose:
167- Plus 1
169- Plus 2
171- Plus 3
173Minuses tight:
175- Minus 1
176- Minus 2
177- Minus 3
179Minuses loose:
181- Minus 1
183- Minus 2
185- Minus 3
187** Ordered
188 :PROPERTIES:
189 :CUSTOM_ID: ordered
190 :END:
191Tight:
1931. First
1942. Second
1953. Third
197and:
1991. One
2002. Two
2013. Three
203Loose using tabs:
2051. First
2072. Second
2093. Third
211and using spaces:
2131. One
2152. Two
2173. Three
219Multiple paragraphs:
2211. Item 1, graf one.
223 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
2252. Item 2.
2273. Item 3.
229** Nested
230 :PROPERTIES:
231 :CUSTOM_ID: nested
232 :END:
234- Tab
236 - Tab
238 - Tab
240Here's another:
2421. First
2432. Second:
245 - Fee
246 - Fie
247 - Foe
2493. Third
251Same thing but with paragraphs:
2531. First
2552. Second:
257 - Fee
258 - Fie
259 - Foe
2613. Third
263** Tabs and spaces
264 :PROPERTIES:
265 :CUSTOM_ID: tabs-and-spaces
266 :END:
268- this is a list item indented with tabs
270- this is a list item indented with spaces
272 - this is an example list item indented with tabs
274 - this is an example list item indented with spaces
276** Fancy list markers
277 :PROPERTIES:
278 :CUSTOM_ID: fancy-list-markers
279 :END:
2812) begins with 2
2833) and now 3
285 with a continuation
287 4. sublist with roman numerals, starting with 4
288 5. more items
290 1) a subsublist
291 2) a subsublist
293Nesting:
2951. Upper Alpha
297 1. Upper Roman.
299 6) Decimal start with 6
301 3) Lower alpha with paren
303Autonumbering:
3051. Autonumber.
3062. More.
308 1. Nested.
310Should not be a list item:
312M.A. 2007
314B. Williams
316--------------
318* Definition Lists
319 :PROPERTIES:
320 :CUSTOM_ID: definition-lists
321 :END:
322Tight using spaces:
324- apple :: red fruit
325- orange :: orange fruit
326- banana :: yellow fruit
328Tight using tabs:
330- apple :: red fruit
331- orange :: orange fruit
332- banana :: yellow fruit
334Loose:
336- apple :: red fruit
338- orange :: orange fruit
340- banana :: yellow fruit
342Multiple blocks with italics:
344- /apple/ :: red fruit
346 contains seeds, crisp, pleasant to taste
348- /orange/ :: orange fruit
350 #+BEGIN_EXAMPLE
351 { orange code block }
352 #+END_EXAMPLE
354 #+BEGIN_QUOTE
355 orange block quote
356 #+END_QUOTE
358Multiple definitions, tight:
360- apple :: red fruit
361 computer
362- orange :: orange fruit
363 bank
365Multiple definitions, loose:
367- apple :: red fruit
369 computer
371- orange :: orange fruit
373 bank
375Blank line after term, indented marker, alternate markers:
377- apple :: red fruit
379 computer
381- orange :: orange fruit
383 1. sublist
384 2. sublist
386* HTML Blocks
387 :PROPERTIES:
388 :CUSTOM_ID: html-blocks
389 :END:
390Simple block on one line:
392foo
394And nested without indentation:
396foo
398bar
400Interpreted markdown in a table:
402#+BEGIN_HTML
403 <table>
404#+END_HTML
406#+BEGIN_HTML
407 <tr>
408#+END_HTML
410#+BEGIN_HTML
411 <td>
412#+END_HTML
414This is /emphasized/
416#+BEGIN_HTML
417 </td>
418#+END_HTML
420#+BEGIN_HTML
421 <td>
422#+END_HTML
424And this is *strong*
426#+BEGIN_HTML
427 </td>
428#+END_HTML
430#+BEGIN_HTML
431 </tr>
432#+END_HTML
434#+BEGIN_HTML
435 </table>
436#+END_HTML
438#+BEGIN_HTML
439 <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
440#+END_HTML
442Here's a simple block:
444foo
446This should be a code block, though:
448#+BEGIN_EXAMPLE
449 <div>
450 foo
451 </div>
452#+END_EXAMPLE
454As should this:
456#+BEGIN_EXAMPLE
457 <div>foo</div>
458#+END_EXAMPLE
460Now, nested:
462foo
464This should just be an HTML comment:
466#+BEGIN_HTML
467 <!-- Comment -->
468#+END_HTML
470Multiline:
472#+BEGIN_HTML
473 <!--
474 Blah
475 Blah
476 -->
477#+END_HTML
479#+BEGIN_HTML
480 <!--
481 This is another comment.
482 -->
483#+END_HTML
485Code block:
487#+BEGIN_EXAMPLE
488 <!-- Comment -->
489#+END_EXAMPLE
491Just plain comment, with trailing spaces on the line:
493#+BEGIN_HTML
494 <!-- foo -->
495#+END_HTML
497Code:
499#+BEGIN_EXAMPLE
500 <hr />
501#+END_EXAMPLE
503Hr's:
505#+BEGIN_HTML
506 <hr>
507#+END_HTML
509#+BEGIN_HTML
510 <hr />
511#+END_HTML
513#+BEGIN_HTML
514 <hr />
515#+END_HTML
517#+BEGIN_HTML
518 <hr>
519#+END_HTML
521#+BEGIN_HTML
522 <hr />
523#+END_HTML
525#+BEGIN_HTML
526 <hr />
527#+END_HTML
529#+BEGIN_HTML
530 <hr class="foo" id="bar" />
531#+END_HTML
533#+BEGIN_HTML
534 <hr class="foo" id="bar" />
535#+END_HTML
537#+BEGIN_HTML
538 <hr class="foo" id="bar">
539#+END_HTML
541--------------
543* Inline Markup
544 :PROPERTIES:
545 :CUSTOM_ID: inline-markup
546 :END:
547This is /emphasized/, and so /is this/.
549This is *strong*, and so *is this*.
551An /[[/url][emphasized link]]/.
553*/This is strong and em./*
555So is */this/* word.
557*/This is strong and em./*
559So is */this/* word.
561This is code: =>=, =$=, =\=, =\$=, =<html>=.
563+This is /strikeout/.+
565Superscripts: a^{bc}d a^{/hello/} a^{hello there}.
567Subscripts: H_{2}O, H_{23}O, H_{many of them}O.
569These should not be superscripts or subscripts, because of the unescaped
570spaces: a^b c^d, a~b c~d.
572--------------
574* Smart quotes, ellipses, dashes
575 :PROPERTIES:
576 :CUSTOM_ID: smart-quotes-ellipses-dashes
577 :END:
578"Hello," said the spider. "'Shelob' is my name."
580'A', 'B', and 'C' are letters.
582'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
584'He said, "I want to go."' Were you alive in the 70's?
586Here is some quoted '=code=' and a "[[http://example.com/?foo=1&bar=2][quoted
587link]]".
589Some dashes: one---two --- three---four --- five.
591Dashes between numbers: 5--7, 255--66, 1987--1999.
593Ellipses...and...and....
595--------------
597* LaTeX
598 :PROPERTIES:
599 :CUSTOM_ID: latex
600 :END:
602- \cite[22-23]{smith.1899}
603- $2+2=4$
604- $x \in y$
605- $\alpha \wedge \omega$
606- $223$
607- $p$-Tree
608- Here's some display math:
609 $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
610- Here's one that has a line break in it: $\alpha + \omega \times x^2$.
612These shouldn't be math:
614- To get the famous equation, write =$e = mc^2$=.
615- $22,000 is a /lot/ of money. So is $34,000. (It worked if "lot" is
616 emphasized.)
617- Shoes ($20) and socks ($5).
618- Escaped =$=: $73 /this should be emphasized/ 23$.
620Here's a LaTeX table:
622\begin{tabular}{|l|l|}\hline
623Animal & Number \\ \hline
624Dog & 2 \\
625Cat & 1 \\ \hline
626\end{tabular}
628--------------
630* Special Characters
631 :PROPERTIES:
632 :CUSTOM_ID: special-characters
633 :END:
634Here is some unicode:
636- I hat: Î
637- o umlaut: ö
638- section: §
639- set membership: ∈
640- copyright: ©
642AT&T has an ampersand in their name.
644AT&T is another way to write it.
646This & that.
6484 < 5.
6506 > 5.
652Backslash: \
654Backtick: `
656Asterisk: *
658Underscore: _
660Left brace: {
662Right brace: }
664Left bracket: [
666Right bracket: ]
668Left paren: (
670Right paren: )
672Greater-than: >
674Hash: #
676Period: .
678Bang: !
680Plus: +
682Minus: -
684--------------
686* Links
687 :PROPERTIES:
688 :CUSTOM_ID: links
689 :END:
690** Explicit
691 :PROPERTIES:
692 :CUSTOM_ID: explicit
693 :END:
694Just a [[/url/][URL]].
696[[/url/][URL and title]].
698[[/url/][URL and title]].
700[[/url/][URL and title]].
702[[/url/][URL and title]]
704[[/url/][URL and title]]
706[[/url/with_underscore][with_underscore]]
708[[mailto:nobody@nowhere.net][Email link]]
710[[][Empty]].
712** Reference
713 :PROPERTIES:
714 :CUSTOM_ID: reference
715 :END:
716Foo [[/url/][bar]].
718With [[/url/][embedded [brackets]]].
720[[/url/][b]] by itself should be a link.
722Indented [[/url][once]].
724Indented [[/url][twice]].
726Indented [[/url][thrice]].
728This should [not][] be a link.
730#+BEGIN_EXAMPLE
731 [not]: /url
732#+END_EXAMPLE
734Foo [[/url/][bar]].
736Foo [[/url/][biz]].
738** With ampersands
739 :PROPERTIES:
740 :CUSTOM_ID: with-ampersands
741 :END:
742Here's a [[http://example.com/?foo=1&bar=2][link with an ampersand in the
743URL]].
745Here's a link with an amersand in the link text: [[http://att.com/][AT&T]].
747Here's an [[/script?foo=1&bar=2][inline link]].
749Here's an [[/script?foo=1&bar=2][inline link in pointy braces]].
751** Autolinks
752 :PROPERTIES:
753 :CUSTOM_ID: autolinks
754 :END:
755With an ampersand: [[http://example.com/?foo=1&bar=2]]
757- In a list?
758- [[http://example.com/]]
759- It should.
761An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
763#+BEGIN_QUOTE
764 Blockquoted: [[http://example.com/]]
765#+END_QUOTE
767Auto-links should not occur here: =<http://example.com/>=
769#+BEGIN_EXAMPLE
770 or here: <http://example.com/>
771#+END_EXAMPLE
773--------------
775* Images
776 :PROPERTIES:
777 :CUSTOM_ID: images
778 :END:
779From "Voyage dans la Lune" by Georges Melies (1902):
781#+CAPTION: lalune
782[[file:lalune.jpg]]
784Here is a movie [[file:movie.jpg]] icon.
786--------------
788* Footnotes
789 :PROPERTIES:
790 :CUSTOM_ID: footnotes
791 :END:
792Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a
793footnote reference, because it contains a space.[^my note] Here is an inline
794note.[fn:3]
796#+BEGIN_QUOTE
797 Notes can go in quotes.[fn:4]
798#+END_QUOTE
8001. And in list items.[fn:5]
802This paragraph should not be part of the note, as it is not indented.
804[fn:1] Here is the footnote. It can go anywhere after the footnote reference.
805 It need not be placed at the end of the document.
807[fn:2] Here's the long note. This one contains multiple blocks.
809 Subsequent blocks are indented to show that they belong to the footnote
810 (as with list items).
812 #+BEGIN_EXAMPLE
813 { <code> }
814 #+END_EXAMPLE
816 If you want, you can indent every line, but you can also be lazy and
817 just indent the first line of each block.
819[fn:3] This is /easier/ to type. Inline notes may contain
820 [[http://google.com][links]] and =]= verbatim characters, as well as
821 [bracketed text].
823[fn:4] In quote.
825[fn:5] In list.