git.iko.soy/typeable/pandoc
on 2.9 help sign in
typeable/pandoc/test/writer.markdown
789 lines 11 kB history raw
1---
2author:
3- John MacFarlane
4- Anonymous
5date: 'July 17, 2006'
6title: Pandoc Test Suite
7---
9This is a set of tests for pandoc. Most of them are adapted from John Gruber's
10markdown test suite.
12------------------------------------------------------------------------------
14Headers
15=======
17Level 2 with an [embedded link](/url)
18-------------------------------------
20### Level 3 with *emphasis*
22#### Level 4
24##### Level 5
26Level 1
27=======
29Level 2 with *emphasis*
30-----------------------
32### Level 3
34with no blank line
36Level 2
37-------
39with no blank line
41------------------------------------------------------------------------------
43Paragraphs
44==========
46Here's a regular paragraph.
48In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
49Because a hard-wrapped line in the middle of a paragraph looked like a list
50item.
52Here's one with a bullet. \* criminey.
54There should be a hard line break\
55here.
57------------------------------------------------------------------------------
59Block Quotes
60============
62E-mail style:
64> This is a block quote. It is pretty short.
66> Code in a block quote:
68> sub status {
69> print "working";
70> }
72> A list:
74> 1. item one
75> 2. item two
77> Nested block quotes:
79> > nested
81> > nested
83This should not be a block quote: 2 \> 1.
85And a following paragraph.
87------------------------------------------------------------------------------
89Code Blocks
90===========
92Code:
94 ---- (should be four hyphens)
96 sub status {
97 print "working";
98 }
100 this code block is indented by one tab
102And:
104 this code block is indented by two tabs
106 These should not be escaped: \$ \\ \> \[ \{
108------------------------------------------------------------------------------
110Lists
111=====
113Unordered
114---------
116Asterisks tight:
118- asterisk 1
119- asterisk 2
120- asterisk 3
122Asterisks loose:
124- asterisk 1
126- asterisk 2
128- asterisk 3
130Pluses tight:
132- Plus 1
133- Plus 2
134- Plus 3
136Pluses loose:
138- Plus 1
140- Plus 2
142- Plus 3
144Minuses tight:
146- Minus 1
147- Minus 2
148- Minus 3
150Minuses loose:
152- Minus 1
154- Minus 2
156- Minus 3
158Ordered
159-------
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.
199Nested
200------
202- Tab
203 - Tab
204 - Tab
206Here's another:
2081. First
2092. Second:
210 - Fee
211 - Fie
212 - Foe
2133. Third
215Same thing but with paragraphs:
2171. First
2192. Second:
221 - Fee
222 - Fie
223 - Foe
2253. Third
227Tabs and spaces
228---------------
230- this is a list item indented with tabs
232- this is a list item indented with spaces
234 - this is an example list item indented with tabs
236 - this is an example list item indented with spaces
238Fancy list markers
239------------------
241(2) begins with 2
243(3) and now 3
245 with a continuation
247 iv. sublist with roman numerals, starting with 4
248 v. more items
249 (A) a subsublist
250 (B) a subsublist
252Nesting:
254A. Upper Alpha
255 I. Upper Roman.
256 (6) Decimal start with 6
257 c) Lower alpha with paren
259Autonumbering:
2611. Autonumber.
2622. More.
263 1. Nested.
265Should not be a list item:
267M.A. 2007
269B. Williams
271------------------------------------------------------------------------------
273Definition Lists
274================
276Tight using spaces:
278apple
279: red fruit
281orange
282: orange fruit
284banana
285: yellow fruit
287Tight using tabs:
289apple
290: red fruit
292orange
293: orange fruit
295banana
296: yellow fruit
298Loose:
300apple
302: red fruit
304orange
306: orange fruit
308banana
310: yellow fruit
312Multiple blocks with italics:
314*apple*
316: red fruit
318 contains seeds, crisp, pleasant to taste
320*orange*
322: orange fruit
324 { orange code block }
326 > orange block quote
328Multiple definitions, tight:
330apple
331: red fruit
332: computer
334orange
335: orange fruit
336: bank
338Multiple definitions, loose:
340apple
342: red fruit
344: computer
346orange
348: orange fruit
350: bank
352Blank line after term, indented marker, alternate markers:
354apple
356: red fruit
358: computer
360orange
362: orange fruit
364 1. sublist
365 2. sublist
367HTML Blocks
368===========
370Simple block on one line:
372<div>
374foo
376</div>
378And nested without indentation:
380<div>
382<div>
384<div>
386foo
388</div>
390</div>
392<div>
394bar
396</div>
398</div>
400Interpreted markdown in a table:
402```{=html}
403<table>
404```
405```{=html}
406<tr>
407```
408```{=html}
409<td>
410```
411This is *emphasized*
412```{=html}
413</td>
414```
415```{=html}
416<td>
417```
418And this is **strong**
419```{=html}
420</td>
421```
422```{=html}
423</tr>
424```
425```{=html}
426</table>
427```
428```{=html}
429<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
430```
431Here's a simple block:
433<div>
435foo
437</div>
439This should be a code block, though:
441 <div>
442 foo
443 </div>
445As should this:
447 <div>foo</div>
449Now, nested:
451<div>
453<div>
455<div>
457foo
459</div>
461</div>
463</div>
465This should just be an HTML comment:
467```{=html}
468<!-- Comment -->
469```
470Multiline:
472```{=html}
473<!--
474Blah
475Blah
476-->
477```
478```{=html}
479<!--
480 This is another comment.
481-->
482```
483Code block:
485 <!-- Comment -->
487Just plain comment, with trailing spaces on the line:
489```{=html}
490<!-- foo -->
491```
492Code:
494 <hr />
496Hr's:
498```{=html}
499<hr>
500```
501```{=html}
502<hr />
503```
504```{=html}
505<hr />
506```
507```{=html}
508<hr>
509```
510```{=html}
511<hr />
512```
513```{=html}
514<hr />
515```
516```{=html}
517<hr class="foo" id="bar" />
518```
519```{=html}
520<hr class="foo" id="bar" />
521```
522```{=html}
523<hr class="foo" id="bar">
524```
526------------------------------------------------------------------------------
528Inline Markup
529=============
531This is *emphasized*, and so *is this*.
533This is **strong**, and so **is this**.
535An *[emphasized link](/url)*.
537***This is strong and em.***
539So is ***this*** word.
541***This is strong and em.***
543So is ***this*** word.
545This is code: `>`, `$`, `\`, `\$`, `<html>`.
547~~This is *strikeout*.~~
549Superscripts: a^bc^d a^*hello*^ a^hello there^.
551Subscripts: H~2~O, H~23~O, H~many of them~O.
553These should not be superscripts or subscripts, because of the unescaped
554spaces: a\^b c\^d, a\~b c\~d.
556------------------------------------------------------------------------------
558Smart quotes, ellipses, dashes
559==============================
561"Hello," said the spider. "'Shelob' is my name."
563'A', 'B', and 'C' are letters.
565'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
567'He said, "I want to go."' Were you alive in the 70's?
569Here is some quoted '`code`' and a "[quoted
570link](http://example.com/?foo=1&bar=2)".
572Some dashes: one---two --- three---four --- five.
574Dashes between numbers: 5--7, 255--66, 1987--1999.
576Ellipses...and...and....
578------------------------------------------------------------------------------
580LaTeX
581=====
583- `\cite[22-23]{smith.1899}`{=tex}
584- $2+2=4$
585- $x \in y$
586- $\alpha \wedge \omega$
587- $223$
588- $p$-Tree
589- Here's some display math:
590 $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
591- Here's one that has a line break in it: $\alpha + \omega \times x^2$.
593These shouldn't be math:
595- To get the famous equation, write `$e = mc^2$`.
596- \$22,000 is a *lot* of money. So is \$34,000. (It worked if "lot" is
597 emphasized.)
598- Shoes (\$20) and socks (\$5).
599- Escaped `$`: \$73 *this should be emphasized* 23\$.
601Here's a LaTeX table:
603```{=tex}
604\begin{tabular}{|l|l|}\hline
605Animal & Number \\ \hline
606Dog & 2 \\
607Cat & 1 \\ \hline
608\end{tabular}
609```
611------------------------------------------------------------------------------
613Special Characters
614==================
616Here is some unicode:
618- I hat: Î
619- o umlaut: ö
620- section: §
621- set membership: ∈
622- copyright: ©
624AT&T has an ampersand in their name.
626AT&T is another way to write it.
628This & that.
6304 \< 5.
6326 \> 5.
634Backslash: \\
636Backtick: \`
638Asterisk: \*
640Underscore: \_
642Left brace: {
644Right brace: }
646Left bracket: \[
648Right bracket: \]
650Left paren: (
652Right paren: )
654Greater-than: \>
656Hash: \#
658Period: .
660Bang: !
662Plus: +
664Minus: -
666------------------------------------------------------------------------------
668Links
669=====
671Explicit
672--------
674Just a [URL](/url/).
676[URL and title](/url/ "title").
678[URL and title](/url/ "title preceded by two spaces").
680[URL and title](/url/ "title preceded by a tab").
682[URL and title](/url/ "title with "quotes" in it")
684[URL and title](/url/ "title with single quotes")
686[with\_underscore](/url/with_underscore)
688[Email link](mailto:nobody@nowhere.net)
690[Empty]().
692Reference
693---------
695Foo [bar](/url/).
697With [embedded \[brackets\]](/url/).
699[b](/url/) by itself should be a link.
701Indented [once](/url).
703Indented [twice](/url).
705Indented [thrice](/url).
707This should \[not\]\[\] be a link.
709 [not]: /url
711Foo [bar](/url/ "Title with "quotes" inside").
713Foo [biz](/url/ "Title with "quote" inside").
715With ampersands
716---------------
718Here's a [link with an ampersand in the URL](http://example.com/?foo=1&bar=2).
720Here's a link with an amersand in the link text:
721[AT&T](http://att.com/ "AT&T").
723Here's an [inline link](/script?foo=1&bar=2).
725Here's an [inline link in pointy braces](/script?foo=1&bar=2).
727Autolinks
728---------
730With an ampersand: <http://example.com/?foo=1&bar=2>
732- In a list?
733- <http://example.com/>
734- It should.
736An e-mail address: <nobody@nowhere.net>
738> Blockquoted: <http://example.com/>
740Auto-links should not occur here: `<http://example.com/>`
742 or here: <http://example.com/>
744------------------------------------------------------------------------------
746Images
747======
749From "Voyage dans la Lune" by Georges Melies (1902):
751![lalune](lalune.jpg "Voyage dans la Lune")
753Here is a movie ![movie](movie.jpg) icon.
755------------------------------------------------------------------------------
757Footnotes
758=========
760Here is a footnote reference,[^1] and another.[^2] This should *not* be a
761footnote reference, because it contains a space.\[\^my note\] Here is an
762inline note.[^3]
764> Notes can go in quotes.[^4]
7661. And in list items.[^5]
768This paragraph should not be part of the note, as it is not indented.
770[^1]: Here is the footnote. It can go anywhere after the footnote reference.
771 It need not be placed at the end of the document.
773[^2]: Here's the long note. This one contains multiple blocks.
775 Subsequent blocks are indented to show that they belong to the footnote
776 (as with list items).
778 { <code> }
780 If you want, you can indent every line, but you can also be lazy and just
781 indent the first line of each block.
783[^3]: This is *easier* to type. Inline notes may contain
784 [links](http://google.com) and `]` verbatim characters, as well as
785 \[bracketed text\].
787[^4]: In quote.
789[^5]: In list.