git.iko.soy/typeable/pandoc
on 2.4 help sign in
typeable/pandoc/test/writer.org
851 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
2973) and now 3
299 with a continuation
301 4. sublist with roman numerals, starting with 4
302 5. more items
304 1) a subsublist
305 2) a subsublist
307Nesting:
3091. Upper Alpha
311 1. Upper Roman.
313 6) Decimal start with 6
315 3) Lower alpha with paren
317Autonumbering:
3191. Autonumber.
3202. More.
322 1. Nested.
324Should not be a list item:
326M.A. 2007
328B. Williams
330--------------
332* Definition Lists
333 :PROPERTIES:
334 :CUSTOM_ID: definition-lists
335 :END:
337Tight using spaces:
339- apple :: red fruit
340- orange :: orange fruit
341- banana :: yellow fruit
343Tight using tabs:
345- apple :: red fruit
346- orange :: orange fruit
347- banana :: yellow fruit
349Loose:
351- apple :: red fruit
353- orange :: orange fruit
355- banana :: yellow fruit
357Multiple blocks with italics:
359- /apple/ :: red fruit
361 contains seeds, crisp, pleasant to taste
363- /orange/ :: orange fruit
365 #+BEGIN_EXAMPLE
366 { orange code block }
367 #+END_EXAMPLE
369 #+BEGIN_QUOTE
370 orange block quote
371 #+END_QUOTE
373Multiple definitions, tight:
375- apple :: red fruit
376 computer
377- orange :: orange fruit
378 bank
380Multiple definitions, loose:
382- apple :: red fruit
384 computer
386- orange :: orange fruit
388 bank
390Blank line after term, indented marker, alternate markers:
392- apple :: red fruit
394 computer
396- orange :: orange fruit
398 1. sublist
399 2. sublist
401* HTML Blocks
402 :PROPERTIES:
403 :CUSTOM_ID: html-blocks
404 :END:
406Simple block on one line:
408foo
410And nested without indentation:
412foo
414bar
416Interpreted markdown in a table:
418#+BEGIN_HTML
419 <table>
420#+END_HTML
422#+BEGIN_HTML
423 <tr>
424#+END_HTML
426#+BEGIN_HTML
427 <td>
428#+END_HTML
430This is /emphasized/
432#+BEGIN_HTML
433 </td>
434#+END_HTML
436#+BEGIN_HTML
437 <td>
438#+END_HTML
440And this is *strong*
442#+BEGIN_HTML
443 </td>
444#+END_HTML
446#+BEGIN_HTML
447 </tr>
448#+END_HTML
450#+BEGIN_HTML
451 </table>
452#+END_HTML
454#+BEGIN_HTML
455 <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
456#+END_HTML
458Here's a simple block:
460foo
462This should be a code block, though:
464#+BEGIN_EXAMPLE
465 <div>
466 foo
467 </div>
468#+END_EXAMPLE
470As should this:
472#+BEGIN_EXAMPLE
473 <div>foo</div>
474#+END_EXAMPLE
476Now, nested:
478foo
480This should just be an HTML comment:
482#+BEGIN_HTML
483 <!-- Comment -->
484#+END_HTML
486Multiline:
488#+BEGIN_HTML
489 <!--
490 Blah
491 Blah
492 -->
493#+END_HTML
495#+BEGIN_HTML
496 <!--
497 This is another comment.
498 -->
499#+END_HTML
501Code block:
503#+BEGIN_EXAMPLE
504 <!-- Comment -->
505#+END_EXAMPLE
507Just plain comment, with trailing spaces on the line:
509#+BEGIN_HTML
510 <!-- foo -->
511#+END_HTML
513Code:
515#+BEGIN_EXAMPLE
516 <hr />
517#+END_EXAMPLE
519Hr's:
521#+BEGIN_HTML
522 <hr>
523#+END_HTML
525#+BEGIN_HTML
526 <hr />
527#+END_HTML
529#+BEGIN_HTML
530 <hr />
531#+END_HTML
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 class="foo" id="bar" />
547#+END_HTML
549#+BEGIN_HTML
550 <hr class="foo" id="bar" />
551#+END_HTML
553#+BEGIN_HTML
554 <hr class="foo" id="bar">
555#+END_HTML
557--------------
559* Inline Markup
560 :PROPERTIES:
561 :CUSTOM_ID: inline-markup
562 :END:
564This is /emphasized/, and so /is this/.
566This is *strong*, and so *is this*.
568An /[[/url][emphasized link]]/.
570*/This is strong and em./*
572So is */this/* word.
574*/This is strong and em./*
576So is */this/* word.
578This is code: =>=, =$=, =\=, =\$=, =<html>=.
580+This is /strikeout/.+
582Superscripts: a^{bc}d a^{/hello/} a^{hello there}.
584Subscripts: H_{2}O, H_{23}O, H_{many of them}O.
586These should not be superscripts or subscripts, because of the unescaped
587spaces: a^b c^d, a~b c~d.
589--------------
591* Smart quotes, ellipses, dashes
592 :PROPERTIES:
593 :CUSTOM_ID: smart-quotes-ellipses-dashes
594 :END:
596"Hello," said the spider. "'Shelob' is my name."
598'A', 'B', and 'C' are letters.
600'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
602'He said, "I want to go."' Were you alive in the 70's?
604Here is some quoted '=code=' and a "[[http://example.com/?foo=1&bar=2][quoted
605link]]".
607Some dashes: one---two --- three---four --- five.
609Dashes between numbers: 5--7, 255--66, 1987--1999.
611Ellipses...and...and....
613--------------
615* LaTeX
616 :PROPERTIES:
617 :CUSTOM_ID: latex
618 :END:
620- \cite[22-23]{smith.1899}
621- $2+2=4$
622- $x \in y$
623- $\alpha \wedge \omega$
624- $223$
625- $p$-Tree
626- Here's some display math:
627 $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
628- Here's one that has a line break in it: $\alpha + \omega \times x^2$.
630These shouldn't be math:
632- To get the famous equation, write =$e = mc^2$=.
633- $22,000 is a /lot/ of money. So is $34,000. (It worked if "lot" is
634 emphasized.)
635- Shoes ($20) and socks ($5).
636- Escaped =$=: $73 /this should be emphasized/ 23$.
638Here's a LaTeX table:
640\begin{tabular}{|l|l|}\hline
641Animal & Number \\ \hline
642Dog & 2 \\
643Cat & 1 \\ \hline
644\end{tabular}
646--------------
648* Special Characters
649 :PROPERTIES:
650 :CUSTOM_ID: special-characters
651 :END:
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
706 :PROPERTIES:
707 :CUSTOM_ID: links
708 :END:
710** Explicit
711 :PROPERTIES:
712 :CUSTOM_ID: explicit
713 :END:
715Just a [[/url/][URL]].
717[[/url/][URL and title]].
719[[/url/][URL and title]].
721[[/url/][URL and title]].
723[[/url/][URL and title]]
725[[/url/][URL and title]]
727[[/url/with_underscore][with_underscore]]
729[[mailto:nobody@nowhere.net][Email link]]
731[[][Empty]].
733** Reference
734 :PROPERTIES:
735 :CUSTOM_ID: reference
736 :END:
738Foo [[/url/][bar]].
740With [[/url/][embedded [brackets]]].
742[[/url/][b]] by itself should be a link.
744Indented [[/url][once]].
746Indented [[/url][twice]].
748Indented [[/url][thrice]].
750This should [not][] be a link.
752#+BEGIN_EXAMPLE
753 [not]: /url
754#+END_EXAMPLE
756Foo [[/url/][bar]].
758Foo [[/url/][biz]].
760** With ampersands
761 :PROPERTIES:
762 :CUSTOM_ID: with-ampersands
763 :END:
765Here's a [[http://example.com/?foo=1&bar=2][link with an ampersand in the
766URL]].
768Here's a link with an amersand in the link text: [[http://att.com/][AT&T]].
770Here's an [[/script?foo=1&bar=2][inline link]].
772Here's an [[/script?foo=1&bar=2][inline link in pointy braces]].
774** Autolinks
775 :PROPERTIES:
776 :CUSTOM_ID: autolinks
777 :END:
779With an ampersand: [[http://example.com/?foo=1&bar=2]]
781- In a list?
782- [[http://example.com/]]
783- It should.
785An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
787#+BEGIN_QUOTE
788 Blockquoted: [[http://example.com/]]
789#+END_QUOTE
791Auto-links should not occur here: =<http://example.com/>=
793#+BEGIN_EXAMPLE
794 or here: <http://example.com/>
795#+END_EXAMPLE
797--------------
799* Images
800 :PROPERTIES:
801 :CUSTOM_ID: images
802 :END:
804From "Voyage dans la Lune" by Georges Melies (1902):
806#+CAPTION: lalune
807[[file:lalune.jpg]]
809Here is a movie [[file:movie.jpg]] icon.
811--------------
813* Footnotes
814 :PROPERTIES:
815 :CUSTOM_ID: footnotes
816 :END:
818Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a
819footnote reference, because it contains a space.[^my note] Here is an inline
820note.[fn:3]
822#+BEGIN_QUOTE
823 Notes can go in quotes.[fn:4]
824#+END_QUOTE
8261. And in list items.[fn:5]
828This paragraph should not be part of the note, as it is not indented.
830[fn:1] Here is the footnote. It can go anywhere after the footnote reference.
831 It need not be placed at the end of the document.
833[fn:2] Here's the long note. This one contains multiple blocks.
835 Subsequent blocks are indented to show that they belong to the footnote
836 (as with list items).
838 #+BEGIN_EXAMPLE
839 { <code> }
840 #+END_EXAMPLE
842 If you want, you can indent every line, but you can also be lazy and
843 just indent the first line of each block.
845[fn:3] This is /easier/ to type. Inline notes may contain
846 [[http://google.com][links]] and =]= verbatim characters, as well as
847 [bracketed text].
849[fn:4] In quote.
851[fn:5] In list.