git.iko.soy/typeable/pandoc
on rc/2.8.1 help sign in
typeable/pandoc/test/writer.org
852 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:
16** Level 2 with an [[/url][embedded link]]
17 :PROPERTIES:
18 :CUSTOM_ID: level-2-with-an-embedded-link
19 :END:
21*** Level 3 with /emphasis/
22 :PROPERTIES:
23 :CUSTOM_ID: level-3-with-emphasis
24 :END:
26**** Level 4
27 :PROPERTIES:
28 :CUSTOM_ID: level-4
29 :END:
31***** Level 5
32 :PROPERTIES:
33 :CUSTOM_ID: level-5
34 :END:
36* Level 1
37 :PROPERTIES:
38 :CUSTOM_ID: level-1
39 :END:
41** Level 2 with /emphasis/
42 :PROPERTIES:
43 :CUSTOM_ID: level-2-with-emphasis
44 :END:
46*** Level 3
47 :PROPERTIES:
48 :CUSTOM_ID: level-3
49 :END:
51with no blank line
53** Level 2
54 :PROPERTIES:
55 :CUSTOM_ID: level-2
56 :END:
58with no blank line
60--------------
62* Paragraphs
63 :PROPERTIES:
64 :CUSTOM_ID: paragraphs
65 :END:
67Here's a regular paragraph.
69In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
70Because a hard-wrapped line in the middle of a paragraph looked like a list
71item.
73Here's one with a bullet. * criminey.
75There should be a hard line break\\
76here.
78--------------
80* Block Quotes
81 :PROPERTIES:
82 :CUSTOM_ID: block-quotes
83 :END:
85E-mail style:
87#+BEGIN_QUOTE
88 This is a block quote. It is pretty short.
89#+END_QUOTE
91#+BEGIN_QUOTE
92 Code in a block quote:
94 #+BEGIN_EXAMPLE
95 sub status {
96 print "working";
97 }
98 #+END_EXAMPLE
100 A list:
102 1. item one
103 2. item two
105 Nested block quotes:
107 #+BEGIN_QUOTE
108 nested
109 #+END_QUOTE
111 #+BEGIN_QUOTE
112 nested
113 #+END_QUOTE
114#+END_QUOTE
116This should not be a block quote: 2 > 1.
118And a following paragraph.
120--------------
122* Code Blocks
123 :PROPERTIES:
124 :CUSTOM_ID: code-blocks
125 :END:
127Code:
129#+BEGIN_EXAMPLE
130 ---- (should be four hyphens)
132 sub status {
133 print "working";
134 }
136 this code block is indented by one tab
137#+END_EXAMPLE
139And:
141#+BEGIN_EXAMPLE
142 this code block is indented by two tabs
144 These should not be escaped: \$ \\ \> \[ \{
145#+END_EXAMPLE
147--------------
149* Lists
150 :PROPERTIES:
151 :CUSTOM_ID: lists
152 :END:
154** Unordered
155 :PROPERTIES:
156 :CUSTOM_ID: unordered
157 :END:
159Asterisks tight:
161- asterisk 1
162- asterisk 2
163- asterisk 3
165Asterisks loose:
167- asterisk 1
169- asterisk 2
171- asterisk 3
173Pluses tight:
175- Plus 1
176- Plus 2
177- Plus 3
179Pluses loose:
181- Plus 1
183- Plus 2
185- Plus 3
187Minuses tight:
189- Minus 1
190- Minus 2
191- Minus 3
193Minuses loose:
195- Minus 1
197- Minus 2
199- Minus 3
201** Ordered
202 :PROPERTIES:
203 :CUSTOM_ID: ordered
204 :END:
206Tight:
2081. First
2092. Second
2103. Third
212and:
2141. One
2152. Two
2163. Three
218Loose using tabs:
2201. First
2222. Second
2243. Third
226and using spaces:
2281. One
2302. Two
2323. Three
234Multiple paragraphs:
2361. Item 1, graf one.
238 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
2402. Item 2.
2423. Item 3.
244** Nested
245 :PROPERTIES:
246 :CUSTOM_ID: nested
247 :END:
249- Tab
251 - Tab
253 - Tab
255Here's another:
2571. First
2582. Second:
260 - Fee
261 - Fie
262 - Foe
2643. Third
266Same thing but with paragraphs:
2681. First
2702. Second:
272 - Fee
273 - Fie
274 - Foe
2763. Third
278** Tabs and spaces
279 :PROPERTIES:
280 :CUSTOM_ID: tabs-and-spaces
281 :END:
283- this is a list item indented with tabs
285- this is a list item indented with spaces
287 - this is an example list item indented with tabs
289 - this is an example list item indented with spaces
291** Fancy list markers
292 :PROPERTIES:
293 :CUSTOM_ID: fancy-list-markers
294 :END:
2962) begins with 2
2983) and now 3
300 with a continuation
302 4. sublist with roman numerals, starting with 4
303 5. more items
305 1) a subsublist
306 2) a subsublist
308Nesting:
3101. Upper Alpha
312 1. Upper Roman.
314 6) Decimal start with 6
316 3) Lower alpha with paren
318Autonumbering:
3201. Autonumber.
3212. More.
323 1. Nested.
325Should not be a list item:
327M.A. 2007
329B. Williams
331--------------
333* Definition Lists
334 :PROPERTIES:
335 :CUSTOM_ID: definition-lists
336 :END:
338Tight using spaces:
340- apple :: red fruit
341- orange :: orange fruit
342- banana :: yellow fruit
344Tight using tabs:
346- apple :: red fruit
347- orange :: orange fruit
348- banana :: yellow fruit
350Loose:
352- apple :: red fruit
354- orange :: orange fruit
356- banana :: yellow fruit
358Multiple blocks with italics:
360- /apple/ :: red fruit
362 contains seeds, crisp, pleasant to taste
364- /orange/ :: orange fruit
366 #+BEGIN_EXAMPLE
367 { orange code block }
368 #+END_EXAMPLE
370 #+BEGIN_QUOTE
371 orange block quote
372 #+END_QUOTE
374Multiple definitions, tight:
376- apple :: red fruit
377 computer
378- orange :: orange fruit
379 bank
381Multiple definitions, loose:
383- apple :: red fruit
385 computer
387- orange :: orange fruit
389 bank
391Blank line after term, indented marker, alternate markers:
393- apple :: red fruit
395 computer
397- orange :: orange fruit
399 1. sublist
400 2. sublist
402* HTML Blocks
403 :PROPERTIES:
404 :CUSTOM_ID: html-blocks
405 :END:
407Simple block on one line:
409foo
411And nested without indentation:
413foo
415bar
417Interpreted markdown in a table:
419#+BEGIN_HTML
420 <table>
421#+END_HTML
423#+BEGIN_HTML
424 <tr>
425#+END_HTML
427#+BEGIN_HTML
428 <td>
429#+END_HTML
431This is /emphasized/
433#+BEGIN_HTML
434 </td>
435#+END_HTML
437#+BEGIN_HTML
438 <td>
439#+END_HTML
441And this is *strong*
443#+BEGIN_HTML
444 </td>
445#+END_HTML
447#+BEGIN_HTML
448 </tr>
449#+END_HTML
451#+BEGIN_HTML
452 </table>
453#+END_HTML
455#+BEGIN_HTML
456 <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
457#+END_HTML
459Here's a simple block:
461foo
463This should be a code block, though:
465#+BEGIN_EXAMPLE
466 <div>
467 foo
468 </div>
469#+END_EXAMPLE
471As should this:
473#+BEGIN_EXAMPLE
474 <div>foo</div>
475#+END_EXAMPLE
477Now, nested:
479foo
481This should just be an HTML comment:
483#+BEGIN_HTML
484 <!-- Comment -->
485#+END_HTML
487Multiline:
489#+BEGIN_HTML
490 <!--
491 Blah
492 Blah
493 -->
494#+END_HTML
496#+BEGIN_HTML
497 <!--
498 This is another comment.
499 -->
500#+END_HTML
502Code block:
504#+BEGIN_EXAMPLE
505 <!-- Comment -->
506#+END_EXAMPLE
508Just plain comment, with trailing spaces on the line:
510#+BEGIN_HTML
511 <!-- foo -->
512#+END_HTML
514Code:
516#+BEGIN_EXAMPLE
517 <hr />
518#+END_EXAMPLE
520Hr's:
522#+BEGIN_HTML
523 <hr>
524#+END_HTML
526#+BEGIN_HTML
527 <hr />
528#+END_HTML
530#+BEGIN_HTML
531 <hr />
532#+END_HTML
534#+BEGIN_HTML
535 <hr>
536#+END_HTML
538#+BEGIN_HTML
539 <hr />
540#+END_HTML
542#+BEGIN_HTML
543 <hr />
544#+END_HTML
546#+BEGIN_HTML
547 <hr class="foo" id="bar" />
548#+END_HTML
550#+BEGIN_HTML
551 <hr class="foo" id="bar" />
552#+END_HTML
554#+BEGIN_HTML
555 <hr class="foo" id="bar">
556#+END_HTML
558--------------
560* Inline Markup
561 :PROPERTIES:
562 :CUSTOM_ID: inline-markup
563 :END:
565This is /emphasized/, and so /is this/.
567This is *strong*, and so *is this*.
569An /[[/url][emphasized link]]/.
571*/This is strong and em./*
573So is */this/* word.
575*/This is strong and em./*
577So is */this/* word.
579This is code: =>=, =$=, =\=, =\$=, =<html>=.
581+This is /strikeout/.+
583Superscripts: a^{bc}d a^{/hello/} a^{hello there}.
585Subscripts: H_{2}O, H_{23}O, H_{many of them}O.
587These should not be superscripts or subscripts, because of the unescaped
588spaces: a^b c^d, a~b c~d.
590--------------
592* Smart quotes, ellipses, dashes
593 :PROPERTIES:
594 :CUSTOM_ID: smart-quotes-ellipses-dashes
595 :END:
597"Hello," said the spider. "'Shelob' is my name."
599'A', 'B', and 'C' are letters.
601'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
603'He said, "I want to go."' Were you alive in the 70's?
605Here is some quoted '=code=' and a "[[http://example.com/?foo=1&bar=2][quoted
606link]]".
608Some dashes: one---two --- three---four --- five.
610Dashes between numbers: 5--7, 255--66, 1987--1999.
612Ellipses...and...and....
614--------------
616* LaTeX
617 :PROPERTIES:
618 :CUSTOM_ID: latex
619 :END:
621- \cite[22-23]{smith.1899}
622- $2+2=4$
623- $x \in y$
624- $\alpha \wedge \omega$
625- $223$
626- $p$-Tree
627- Here's some display math:
628 $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
629- Here's one that has a line break in it: $\alpha + \omega \times x^2$.
631These shouldn't be math:
633- To get the famous equation, write =$e = mc^2$=.
634- $22,000 is a /lot/ of money. So is $34,000. (It worked if "lot" is
635 emphasized.)
636- Shoes ($20) and socks ($5).
637- Escaped =$=: $73 /this should be emphasized/ 23$.
639Here's a LaTeX table:
641\begin{tabular}{|l|l|}\hline
642Animal & Number \\ \hline
643Dog & 2 \\
644Cat & 1 \\ \hline
645\end{tabular}
647--------------
649* Special Characters
650 :PROPERTIES:
651 :CUSTOM_ID: special-characters
652 :END:
654Here is some unicode:
656- I hat: Î
657- o umlaut: ö
658- section: §
659- set membership: ∈
660- copyright: ©
662AT&T has an ampersand in their name.
664AT&T is another way to write it.
666This & that.
6684 < 5.
6706 > 5.
672Backslash: \
674Backtick: `
676Asterisk: *
678Underscore: _
680Left brace: {
682Right brace: }
684Left bracket: [
686Right bracket: ]
688Left paren: (
690Right paren: )
692Greater-than: >
694Hash: #
696Period: .
698Bang: !
700Plus: +
702Minus: -
704--------------
706* Links
707 :PROPERTIES:
708 :CUSTOM_ID: links
709 :END:
711** Explicit
712 :PROPERTIES:
713 :CUSTOM_ID: explicit
714 :END:
716Just a [[/url/][URL]].
718[[/url/][URL and title]].
720[[/url/][URL and title]].
722[[/url/][URL and title]].
724[[/url/][URL and title]]
726[[/url/][URL and title]]
728[[/url/with_underscore][with_underscore]]
730[[mailto:nobody@nowhere.net][Email link]]
732[[][Empty]].
734** Reference
735 :PROPERTIES:
736 :CUSTOM_ID: reference
737 :END:
739Foo [[/url/][bar]].
741With [[/url/][embedded [brackets]]].
743[[/url/][b]] by itself should be a link.
745Indented [[/url][once]].
747Indented [[/url][twice]].
749Indented [[/url][thrice]].
751This should [not][] be a link.
753#+BEGIN_EXAMPLE
754 [not]: /url
755#+END_EXAMPLE
757Foo [[/url/][bar]].
759Foo [[/url/][biz]].
761** With ampersands
762 :PROPERTIES:
763 :CUSTOM_ID: with-ampersands
764 :END:
766Here's a [[http://example.com/?foo=1&bar=2][link with an ampersand in the
767URL]].
769Here's a link with an amersand in the link text: [[http://att.com/][AT&T]].
771Here's an [[/script?foo=1&bar=2][inline link]].
773Here's an [[/script?foo=1&bar=2][inline link in pointy braces]].
775** Autolinks
776 :PROPERTIES:
777 :CUSTOM_ID: autolinks
778 :END:
780With an ampersand: [[http://example.com/?foo=1&bar=2]]
782- In a list?
783- [[http://example.com/]]
784- It should.
786An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
788#+BEGIN_QUOTE
789 Blockquoted: [[http://example.com/]]
790#+END_QUOTE
792Auto-links should not occur here: =<http://example.com/>=
794#+BEGIN_EXAMPLE
795 or here: <http://example.com/>
796#+END_EXAMPLE
798--------------
800* Images
801 :PROPERTIES:
802 :CUSTOM_ID: images
803 :END:
805From "Voyage dans la Lune" by Georges Melies (1902):
807#+CAPTION: lalune
808[[file:lalune.jpg]]
810Here is a movie [[file:movie.jpg]] icon.
812--------------
814* Footnotes
815 :PROPERTIES:
816 :CUSTOM_ID: footnotes
817 :END:
819Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a
820footnote reference, because it contains a space.[^my note] Here is an inline
821note.[fn:3]
823#+BEGIN_QUOTE
824 Notes can go in quotes.[fn:4]
825#+END_QUOTE
8271. And in list items.[fn:5]
829This paragraph should not be part of the note, as it is not indented.
831[fn:1] Here is the footnote. It can go anywhere after the footnote reference.
832 It need not be placed at the end of the document.
834[fn:2] Here's the long note. This one contains multiple blocks.
836 Subsequent blocks are indented to show that they belong to the footnote
837 (as with list items).
839 #+BEGIN_EXAMPLE
840 { <code> }
841 #+END_EXAMPLE
843 If you want, you can indent every line, but you can also be lazy and
844 just indent the first line of each block.
846[fn:3] This is /easier/ to type. Inline notes may contain
847 [[http://google.com][links]] and =]= verbatim characters, as well as
848 [bracketed text].
850[fn:4] In quote.
852[fn:5] In list.