git.iko.soy/typeable/pandoc
on 2.12 help sign in
typeable/pandoc/test/writer.jira
538 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{noformat}
37sub status {
38 print "working";
39}{noformat}
40A list:
42# item one
43# item two
45Nested block quotes:
47bq. nested
48bq. nested
49{quote}
50This should not be a block quote: 2 > 1.
52And a following paragraph.
54----
55h1. {anchor:code-blocks}Code Blocks
56Code:
58{noformat}
59---- (should be four hyphens)
61sub status {
62 print "working";
65this code block is indented by one tab{noformat}
66And:
68{noformat}
69 this code block is indented by two tabs
71These should not be escaped: \$ \\ \> \[ \{{noformat}
72----
73h1. {anchor:lists}Lists
74h2. {anchor:unordered}Unordered
75Asterisks tight:
77* asterisk 1
78* asterisk 2
79* asterisk 3
81Asterisks loose:
83* asterisk 1
84* asterisk 2
85* asterisk 3
87Pluses tight:
89* Plus 1
90* Plus 2
91* Plus 3
93Pluses loose:
95* Plus 1
96* Plus 2
97* Plus 3
99Minuses tight:
101* Minus 1
102* Minus 2
103* Minus 3
105Minuses loose:
107* Minus 1
108* Minus 2
109* Minus 3
111h2. {anchor:ordered}Ordered
112Tight:
114# First
115# Second
116# Third
118and:
120# One
121# Two
122# Three
124Loose using tabs:
126# First
127# Second
128# Third
130and using spaces:
132# One
133# Two
134# Three
136Multiple paragraphs:
138# Item 1, graf one.
139Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.
140# Item 2.
141# Item 3.
143h2. {anchor:nested}Nested
144* Tab
145** Tab
146*** Tab
148Here’s another:
150# First
151# Second:
152#* Fee
153#* Fie
154#* Foe
155# Third
157Same thing but with paragraphs:
159# First
160# Second:
161#* Fee
162#* Fie
163#* Foe
164# Third
166h2. {anchor:tabs-and-spaces}Tabs and spaces
167* this is a list item indented with tabs
168* this is a list item indented with spaces
169** this is an example list item indented with tabs
170** this is an example list item indented with spaces
172h2. {anchor:fancy-list-markers}Fancy list markers
173# begins with 2
174# and now 3
175with a continuation
176## sublist with roman numerals, starting with 4
177## more items
178### a subsublist
179### a subsublist
181Nesting:
183# Upper Alpha
184## Upper Roman.
185### Decimal start with 6
186#### Lower alpha with paren
188Autonumbering:
190# Autonumber.
191# More.
192## Nested.
194Should not be a list item:
196M.A. 2007
198B. Williams
200----
201h1. {anchor:definition-lists}Definition Lists
202Tight using spaces:
204* *apple*
205red fruit
206* *orange*
207orange fruit
208* *banana*
209yellow fruit
211Tight using tabs:
213* *apple*
214red fruit
215* *orange*
216orange fruit
217* *banana*
218yellow fruit
220Loose:
222* *apple*
223red fruit
224* *orange*
225orange fruit
226* *banana*
227yellow fruit
229Multiple blocks with italics:
231* *_apple_*
232red fruit
233contains seeds, crisp, pleasant to taste
234* *_orange_*
235orange fruit
236{noformat}
237{ orange code block }{noformat}
238bq. orange block quote
240Multiple definitions, tight:
242* *apple*
243red fruit
244computer
245* *orange*
246orange fruit
247bank
249Multiple definitions, loose:
251* *apple*
252red fruit
253computer
254* *orange*
255orange fruit
256bank
258Blank line after term, indented marker, alternate markers:
260* *apple*
261red fruit
262computer
263* *orange*
264orange fruit
265*# sublist
266*# sublist
268h1. {anchor:html-blocks}HTML Blocks
269Simple block on one line:
271foo
273And nested without indentation:
275foo
277bar
279Interpreted markdown in a table:
281This is _emphasized_
283And this is *strong*
285Here’s a simple block:
287foo
289This should be a code block, though:
291{noformat}
292<div>
293 foo
294</div>{noformat}
295As should this:
297{noformat}
298<div>foo</div>{noformat}
299Now, nested:
301foo
303This should just be an HTML comment:
305Multiline:
307Code block:
309{noformat}
310<!-- Comment -->{noformat}
311Just plain comment, with trailing spaces on the line:
313Code:
315{noformat}
316<hr />{noformat}
317Hr’s:
319----
320h1. {anchor:inline-markup}Inline Markup
321This is _emphasized_, and so _is this_.
323This is *strong*, and so *is this*.
325An _[emphasized link|/url]_.
327*_This is strong and em._*
329So is *_this_* word.
331*_This is strong and em._*
333So is *_this_* word.
335This is code: {{>}}, {{$}}, {{&bsol;}}, {{&bsol;$}}, {{<html>}}.
337-This is _strikeout_.-
339Superscripts: a{^}bc{^}d a{^}_hello_{^} a{^}hello there{^}.
341Subscripts: H{~}2{~}O, H{~}23{~}O, H{~}many of them{~}O.
343These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
345----
346h1. {anchor:smart-quotes-ellipses-dashes}Smart quotes, ellipses, dashes
347"Hello," said the spider. "'Shelob' is my name."
349'A', 'B', and 'C' are letters.
351'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
353'He said, "I want to go."' Were you alive in the 70’s?
355Here is some quoted '{{code}}' and a "[quoted link|http://example.com/?foo=1&bar=2]".
357Some dashes: one—two — three—four — five.
359Dashes between numbers: 5–7, 255–66, 1987–1999.
361Ellipses…and…and….
363----
364h1. {anchor:latex}LaTeX
365*
366* 2 + 2 = 4
367* _x_ ∈ {_}y{_}
368* _α_ ∧ {_}ω{_}
369* 223
370* _p_\-Tree
371* Here’s some display math:
372$$\frac\{d\}\{dx\}f\(x)=\lim\_\{h\to 0\}&bsol;frac\{f(x+h)-f\(x)\}\{h\}$$
374* Here’s one that has a line break in it: _α_ + {_}ω{_} × {_}x{_}^2^.
376These shouldn’t be math:
378* To get the famous equation, write {{$e = mc^2$}}.
379* $22,000 is a _lot_ of money. So is $34,000. \(It worked if "lot" is emphasized.)
380* Shoes \($20) and socks \($5).
381* Escaped {{$}}: $73 _this should be emphasized_ 23$.
383Here’s a LaTeX table:
385----
386h1. {anchor:special-characters}Special Characters
387Here is some unicode:
389* I hat: Î
390* o umlaut: ö
391* section: §
392* set membership: ∈
393* copyright: ©
395AT&T has an ampersand in their name.
397AT&T is another way to write it.
399This & that.
4014 < 5.
4036 > 5.
405Backslash: &bsol;
407Backtick: `
409Asterisk: \*
411Underscore: \_
413Left brace: \{
415Right brace: \}
417Left bracket: \[
419Right bracket: \]
421Left paren: \(
423Right paren: )
425Greater-than: >
427Hash: #
429Period: .
431Bang: \!
433Plus: \+
435Minus: \-
437----
438h1. {anchor:links}Links
439h2. {anchor:explicit}Explicit
440Just a [URL|/url/].
442[URL and title|/url/].
444[URL and title|/url/].
446[URL and title|/url/].
448[URL and title|/url/]
450[URL and title|/url/]
452[with_underscore|/url/with_underscore]
454[Email link|mailto:nobody@nowhere.net]
456[Empty|].
458h2. {anchor:reference}Reference
459Foo [bar|/url/].
461With [embedded \[brackets\]|/url/].
463[b|/url/] by itself should be a link.
465Indented [once|/url].
467Indented [twice|/url].
469Indented [thrice|/url].
471This should \[not\]\[\] be a link.
473{noformat}
474[not]: /url{noformat}
475Foo [bar|/url/].
477Foo [biz|/url/].
479h2. {anchor:with-ampersands}With ampersands
480Here’s a [link with an ampersand in the URL|http://example.com/?foo=1&bar=2].
482Here’s a link with an amersand in the link text: [AT&T|http://att.com/].
484Here’s an [inline link|/script?foo=1&bar=2].
486Here’s an [inline link in pointy braces|/script?foo=1&bar=2].
488h2. {anchor:autolinks}Autolinks
489With an ampersand: [http://example.com/?foo=1&bar=2]
491* In a list?
492* [http://example.com/]
493* It should.
495An e-mail address: [mailto:nobody@nowhere.net]
497bq. Blockquoted: [http://example.com/]
498Auto-links should not occur here: {{<http://example.com/>}}
500{noformat}
501or here: <http://example.com/>{noformat}
502----
503h1. {anchor:images}Images
504From "Voyage dans la Lune" by Georges Melies \(1902):
506!lalune.jpg|title=fig:Voyage dans la Lune, alt=lalune!
508Here is a movie !movie.jpg|alt=movie! icon.
510----
511h1. {anchor:footnotes}Footnotes
512Here 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]
514bq. Notes can go in quotes.[4]
515# And in list items.[5]
517This paragraph should not be part of the note, as it is not indented.
520\[1] Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
523\[2] Here’s the long note. This one contains multiple blocks.
525Subsequent blocks are indented to show that they belong to the footnote \(as with list items).
527{noformat}
528 { <code> }{noformat}
529If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
532\[3] This is _easier_ to type. Inline notes may contain [links|http://google.com] and {{\]}} verbatim characters, as well as \[bracketed text].
535\[4] In quote.
538\[5] In list.