git.iko.soy/typeable/pandoc
on lowmem help sign in
typeable/pandoc/test/writer.jira
549 lines 8.8 kB history raw
1This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.
3----
4h1. {anchor:headers}Headers
5h2. {anchor:level-2-with-an-embedded-link}Level 2 with an [embedded link|/url]
6h3. {anchor:level-3-with-emphasis}Level 3 with _emphasis_
7h4. {anchor:level-4}Level 4
8h5. {anchor:level-5}Level 5
9h1. {anchor:level-1}Level 1
10h2. {anchor:level-2-with-emphasis}Level 2 with _emphasis_
11h3. {anchor:level-3}Level 3
12with no blank line
14h2. {anchor:level-2}Level 2
15with no blank line
17----
18h1. {anchor:paragraphs}Paragraphs
19Here’s a regular paragraph.
21In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.
23Here’s one with a bullet. * criminey.
25There should be a hard line break
26here.
28----
29h1. {anchor:block-quotes}Block Quotes
30E-mail style:
32bq. This is a block quote. It is pretty short.
33{quote}
34Code in a block quote:
36{code:java}
37sub status {
38 print "working";
40{code}
41A list:
43# item one
44# item two
46Nested block quotes:
48bq. nested
49bq. nested
50{quote}
51This should not be a block quote: 2 > 1.
53And a following paragraph.
55----
56h1. {anchor:code-blocks}Code Blocks
57Code:
59{code:java}
60---- (should be four hyphens)
62sub status {
63 print "working";
66this code block is indented by one tab
67{code}
68And:
70{code:java}
71 this code block is indented by two tabs
73These should not be escaped: \$ \\ \> \[ \{
74{code}
75----
76h1. {anchor:lists}Lists
77h2. {anchor:unordered}Unordered
78Asterisks tight:
80* asterisk 1
81* asterisk 2
82* asterisk 3
84Asterisks loose:
86* asterisk 1
87* asterisk 2
88* asterisk 3
90Pluses tight:
92* Plus 1
93* Plus 2
94* Plus 3
96Pluses loose:
98* Plus 1
99* Plus 2
100* Plus 3
102Minuses tight:
104* Minus 1
105* Minus 2
106* Minus 3
108Minuses loose:
110* Minus 1
111* Minus 2
112* Minus 3
114h2. {anchor:ordered}Ordered
115Tight:
117# First
118# Second
119# Third
121and:
123# One
124# Two
125# Three
127Loose using tabs:
129# First
130# Second
131# Third
133and using spaces:
135# One
136# Two
137# Three
139Multiple paragraphs:
141# Item 1, graf one.
142Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.
143# Item 2.
144# Item 3.
146h2. {anchor:nested}Nested
147* Tab
148** Tab
149*** Tab
151Here’s another:
153# First
154# Second:
155#* Fee
156#* Fie
157#* Foe
158# Third
160Same thing but with paragraphs:
162# First
163# Second:
164#* Fee
165#* Fie
166#* Foe
167# Third
169h2. {anchor:tabs-and-spaces}Tabs and spaces
170* this is a list item indented with tabs
171* this is a list item indented with spaces
172** this is an example list item indented with tabs
173** this is an example list item indented with spaces
175h2. {anchor:fancy-list-markers}Fancy list markers
176# begins with 2
177# and now 3
178with a continuation
179## sublist with roman numerals, starting with 4
180## more items
181### a subsublist
182### a subsublist
184Nesting:
186# Upper Alpha
187## Upper Roman.
188### Decimal start with 6
189#### Lower alpha with paren
191Autonumbering:
193# Autonumber.
194# More.
195## Nested.
197Should not be a list item:
199M.A. 2007
201B. Williams
203----
204h1. {anchor:definition-lists}Definition Lists
205Tight using spaces:
207* *apple*
208red fruit
209* *orange*
210orange fruit
211* *banana*
212yellow fruit
214Tight using tabs:
216* *apple*
217red fruit
218* *orange*
219orange fruit
220* *banana*
221yellow fruit
223Loose:
225* *apple*
226red fruit
227* *orange*
228orange fruit
229* *banana*
230yellow fruit
232Multiple blocks with italics:
234* *_apple_*
235red fruit
236contains seeds, crisp, pleasant to taste
237* *_orange_*
238orange fruit
239{code:java}
240{ orange code block }
241{code}
242bq. orange block quote
244Multiple definitions, tight:
246* *apple*
247red fruit
248computer
249* *orange*
250orange fruit
251bank
253Multiple definitions, loose:
255* *apple*
256red fruit
257computer
258* *orange*
259orange fruit
260bank
262Blank line after term, indented marker, alternate markers:
264* *apple*
265red fruit
266computer
267* *orange*
268orange fruit
269*# sublist
270*# sublist
272h1. {anchor:html-blocks}HTML Blocks
273Simple block on one line:
275foo
277And nested without indentation:
279foo
281bar
283Interpreted markdown in a table:
285This is _emphasized_
287And this is *strong*
289Here’s a simple block:
291foo
293This should be a code block, though:
295{code:java}
296<div>
297 foo
298</div>
299{code}
300As should this:
302{code:java}
303<div>foo</div>
304{code}
305Now, nested:
307foo
309This should just be an HTML comment:
311Multiline:
313Code block:
315{code:java}
316<!-- Comment -->
317{code}
318Just plain comment, with trailing spaces on the line:
320Code:
322{code:java}
323<hr />
324{code}
325Hr’s:
327----
328h1. {anchor:inline-markup}Inline Markup
329This is _emphasized_, and so _is this_.
331This is *strong*, and so *is this*.
333An _[emphasized link|/url]_.
335*_This is strong and em._*
337So is *_this_* word.
339*_This is strong and em._*
341So is *_this_* word.
343This is code: {{>}}, {{$}}, {{&bsol;}}, {{&bsol;$}}, {{<html>}}.
345-This is _strikeout_.-
347Superscripts: a{^}bc{^}d a{^}_hello_{^} a{^}hello there{^}.
349Subscripts: H{~}2{~}O, H{~}23{~}O, H{~}many of them{~}O.
351These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
353----
354h1. {anchor:smart-quotes-ellipses-dashes}Smart quotes, ellipses, dashes
355"Hello," said the spider. "'Shelob' is my name."
357'A', 'B', and 'C' are letters.
359'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
361'He said, "I want to go."' Were you alive in the 70’s?
363Here is some quoted '{{code}}' and a "[quoted link|http://example.com/?foo=1&bar=2]".
365Some dashes: one—two — three—four — five.
367Dashes between numbers: 5–7, 255–66, 1987–1999.
369Ellipses…and…and….
371----
372h1. {anchor:latex}LaTeX
373*
374* 2 + 2 = 4
375* _x_ ∈ {_}y{_}
376* _α_ ∧ {_}ω{_}
377* 223
378* _p_\-Tree
379* Here’s some display math:
380$$\frac\{d\}\{dx\}f\(x)=\lim\_\{h\to 0\}&bsol;frac\{f(x+h)-f\(x)\}\{h\}$$
382* Here’s one that has a line break in it: _α_ + {_}ω{_} × {_}x{_}^2^.
384These shouldn’t be math:
386* To get the famous equation, write {{$e = mc^2$}}.
387* $22,000 is a _lot_ of money. So is $34,000. \(It worked if "lot" is emphasized.)
388* Shoes \($20) and socks \($5).
389* Escaped {{$}}: $73 _this should be emphasized_ 23$.
391Here’s a LaTeX table:
393----
394h1. {anchor:special-characters}Special Characters
395Here is some unicode:
397* I hat: Î
398* o umlaut: ö
399* section: §
400* set membership: ∈
401* copyright: ©
403AT&T has an ampersand in their name.
405AT&T is another way to write it.
407This & that.
4094 < 5.
4116 > 5.
413Backslash: &bsol;
415Backtick: `
417Asterisk: \*
419Underscore: \_
421Left brace: \{
423Right brace: \}
425Left bracket: \[
427Right bracket: \]
429Left paren: \(
431Right paren: )
433Greater-than: >
435Hash: #
437Period: .
439Bang: \!
441Plus: \+
443Minus: \-
445----
446h1. {anchor:links}Links
447h2. {anchor:explicit}Explicit
448Just a [URL|/url/].
450[URL and title|/url/].
452[URL and title|/url/].
454[URL and title|/url/].
456[URL and title|/url/]
458[URL and title|/url/]
460[with_underscore|/url/with_underscore]
462[Email link|mailto:nobody@nowhere.net]
464[Empty|].
466h2. {anchor:reference}Reference
467Foo [bar|/url/].
469With [embedded \[brackets\]|/url/].
471[b|/url/] by itself should be a link.
473Indented [once|/url].
475Indented [twice|/url].
477Indented [thrice|/url].
479This should \[not\]\[\] be a link.
481{code:java}
482[not]: /url
483{code}
484Foo [bar|/url/].
486Foo [biz|/url/].
488h2. {anchor:with-ampersands}With ampersands
489Here’s a [link with an ampersand in the URL|http://example.com/?foo=1&bar=2].
491Here’s a link with an amersand in the link text: [AT&T|http://att.com/].
493Here’s an [inline link|/script?foo=1&bar=2].
495Here’s an [inline link in pointy braces|/script?foo=1&bar=2].
497h2. {anchor:autolinks}Autolinks
498With an ampersand: [http://example.com/?foo=1&bar=2]
500* In a list?
501* [http://example.com/]
502* It should.
504An e-mail address: [mailto:nobody@nowhere.net]
506bq. Blockquoted: [http://example.com/]
507Auto-links should not occur here: {{<http://example.com/>}}
509{code:java}
510or here: <http://example.com/>
511{code}
512----
513h1. {anchor:images}Images
514From "Voyage dans la Lune" by Georges Melies \(1902):
516!lalune.jpg|title=fig:Voyage dans la Lune, alt=lalune!
518Here is a movie !movie.jpg|alt=movie! icon.
520----
521h1. {anchor:footnotes}Footnotes
522Here is a footnote reference,[1] and another.[2] This should _not_ be a footnote reference, because it contains a space.\[\^my note\] Here is an inline note.[3]
524bq. Notes can go in quotes.[4]
525# And in list items.[5]
527This paragraph should not be part of the note, as it is not indented.
530\[1] Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
533\[2] Here’s the long note. This one contains multiple blocks.
535Subsequent blocks are indented to show that they belong to the footnote \(as with list items).
537{code:java}
538 { <code> }
539{code}
540If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
543\[3] This is _easier_ to type. Inline notes may contain [links|http://google.com] and {{\]}} verbatim characters, as well as \[bracketed text].
546\[4] In quote.
549\[5] In list.