git.iko.soy/typeable/pandoc
on 2.9 help sign in
typeable/pandoc/test/writer.jira
626 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----
5h1. {anchor:headers}Headers
7h2. {anchor:level-2-with-an-embedded-link}Level 2 with an [embedded link|/url]
9h3. {anchor:level-3-with-emphasis}Level 3 with _emphasis_
11h4. {anchor:level-4}Level 4
13h5. {anchor:level-5}Level 5
15h1. {anchor:level-1}Level 1
17h2. {anchor:level-2-with-emphasis}Level 2 with _emphasis_
19h3. {anchor:level-3}Level 3
21with no blank line
23h2. {anchor:level-2}Level 2
25with no blank line
27----
29h1. {anchor:paragraphs}Paragraphs
31Here’s a regular paragraph.
33In 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.
35Here’s one with a bullet. \* criminey.
37There should be a hard line break
38here.
40----
42h1. {anchor:block-quotes}Block Quotes
44E\-mail style:
46bq. This is a block quote. It is pretty short.
48{quote}
49Code in a block quote:
51{code}
52sub status {
53 print "working";
55{code}
57A list:
59# item one
60# item two
62Nested block quotes:
64bq. nested
66bq. nested
68{quote}
71This should not be a block quote: 2 > 1.
73And a following paragraph.
75----
77h1. {anchor:code-blocks}Code Blocks
79Code:
81{code}
82---- (should be four hyphens)
84sub status {
85 print "working";
88this code block is indented by one tab
89{code}
91And:
93{code}
94 this code block is indented by two tabs
96These should not be escaped: \$ \\ \> \[ \{
97{code}
99----
101h1. {anchor:lists}Lists
103h2. {anchor:unordered}Unordered
105Asterisks tight:
107* asterisk 1
108* asterisk 2
109* asterisk 3
111Asterisks loose:
113* asterisk 1
114* asterisk 2
115* asterisk 3
117Pluses tight:
119* Plus 1
120* Plus 2
121* Plus 3
123Pluses loose:
125* Plus 1
126* Plus 2
127* Plus 3
129Minuses tight:
131* Minus 1
132* Minus 2
133* Minus 3
135Minuses loose:
137* Minus 1
138* Minus 2
139* Minus 3
141h2. {anchor:ordered}Ordered
143Tight:
145# First
146# Second
147# Third
149and:
151# One
152# Two
153# Three
155Loose using tabs:
157# First
158# Second
159# Third
161and using spaces:
163# One
164# Two
165# Three
167Multiple paragraphs:
169# Item 1, graf one.
170Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.
171# Item 2.
172# Item 3.
174h2. {anchor:nested}Nested
176* Tab
177** Tab
178*** Tab
180Here’s another:
182# First
183# Second:
184#* Fee
185#* Fie
186#* Foe
187# Third
189Same thing but with paragraphs:
191# First
192# Second:
193#* Fee
194#* Fie
195#* Foe
196# Third
198h2. {anchor:tabs-and-spaces}Tabs and spaces
200* this is a list item indented with tabs
201* this is a list item indented with spaces
202** this is an example list item indented with tabs
203** this is an example list item indented with spaces
205h2. {anchor:fancy-list-markers}Fancy list markers
207# begins with 2
208# and now 3
209with a continuation
210## sublist with roman numerals, starting with 4
211## more items
212### a subsublist
213### a subsublist
215Nesting:
217# Upper Alpha
218## Upper Roman.
219### Decimal start with 6
220#### Lower alpha with paren
222Autonumbering:
224# Autonumber.
225# More.
226## Nested.
228Should not be a list item:
230M.A. 2007
232B. Williams
234----
236h1. {anchor:definition-lists}Definition Lists
238Tight using spaces:
240* *apple*
241red fruit
242* *orange*
243orange fruit
244* *banana*
245yellow fruit
247Tight using tabs:
249* *apple*
250red fruit
251* *orange*
252orange fruit
253* *banana*
254yellow fruit
256Loose:
258* *apple*
259red fruit
260* *orange*
261orange fruit
262* *banana*
263yellow fruit
265Multiple blocks with italics:
267* *_apple_*
268red fruit
269contains seeds, crisp, pleasant to taste
270* *_orange_*
271orange fruit
272{code}
273{ orange code block }
274{code}
275bq. orange block quote
277Multiple definitions, tight:
279* *apple*
280red fruit
281computer
282* *orange*
283orange fruit
284bank
286Multiple definitions, loose:
288* *apple*
289red fruit
290computer
291* *orange*
292orange fruit
293bank
295Blank line after term, indented marker, alternate markers:
297* *apple*
298red fruit
299computer
300* *orange*
301orange fruit
302*# sublist
303*# sublist
305h1. {anchor:html-blocks}HTML Blocks
307Simple block on one line:
309foo
310And nested without indentation:
312foo
314bar
315Interpreted markdown in a table:
320This is _emphasized_
323And this is *strong*
328Here’s a simple block:
330foo
332This should be a code block, though:
334{code}
335<div>
336 foo
337</div>
338{code}
340As should this:
342{code}
343<div>foo</div>
344{code}
346Now, nested:
348foo
349This should just be an HTML comment:
352Multiline:
356Code block:
358{code}
359<!-- Comment -->
360{code}
362Just plain comment, with trailing spaces on the line:
365Code:
367{code}
368<hr />
369{code}
371Hr’s:
382----
384h1. {anchor:inline-markup}Inline Markup
386This is _emphasized_, and so _is this_.
388This is *strong*, and so *is this*.
390An _[emphasized link|/url]_.
392*_This is strong and em._*
394So is *_this_* word.
396*_This is strong and em._*
398So is *_this_* word.
400This is code: {{>}}, {{$}}, {{\}}, {{\$}}, {{<html>}}.
402-This is _strikeout_.-
404Superscripts: a{^bc^}d a{^_hello_^} a{^hello there^}.
406Subscripts: H{~2~}O, H{~23~}O, H{~many of them~}O.
408These should not be superscripts or subscripts, because of the unescaped spaces: a\^b c\^d, a\~b c\~d.
410----
412h1. {anchor:smart-quotes-ellipses-dashes}Smart quotes, ellipses, dashes
414"Hello," said the spider. "'Shelob' is my name."
416'A', 'B', and 'C' are letters.
418'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
420'He said, "I want to go."' Were you alive in the 70’s?
422Here is some quoted '{{code}}' and a "[quoted link|http://example.com/?foo=1&bar=2]".
424Some dashes: one --- two --- three --- four --- five.
426Dashes between numbers: 5 -- 7, 255 -- 66, 1987 -- 1999.
428Ellipses...and...and....
430----
432h1. {anchor:latex}LaTeX
434*
435* 2 \+ 2 = 4
436* _x_ ∈ _y_
437* _α_ ∧ _ω_
438* 223
439* _p_\-Tree
440* Here’s some display math: \\$$\frac\{d\}\{dx\}f(x)=\lim\_\{h\to 0\}\frac\{f(x\+h)\-f(x)\}\{h\}$$\\
441* Here’s one that has a line break in it: _α_ \+ _ω_ × _x_{^2^}.
443These shouldn’t be math:
445* To get the famous equation, write {{$e = mc^2$}}.
446* $22,000 is a _lot_ of money. So is $34,000. (It worked if "lot" is emphasized.)
447* Shoes ($20) and socks ($5).
448* Escaped {{$}}: $73 _this should be emphasized_ 23$.
450Here’s a LaTeX table:
453----
455h1. {anchor:special-characters}Special Characters
457Here is some unicode:
459* I hat: Î
460* o umlaut: ö
461* section: §
462* set membership: ∈
463* copyright: ©
465AT&T has an ampersand in their name.
467AT&T is another way to write it.
469This & that.
4714 < 5.
4736 > 5.
475Backslash: \
477Backtick: `
479Asterisk: \*
481Underscore: \_
483Left brace: \{
485Right brace: \}
487Left bracket: \[
489Right bracket: \]
491Left paren: (
493Right paren: )
495Greater\-than: >
497Hash: #
499Period: .
501Bang: \!
503Plus: \+
505Minus: \-
507----
509h1. {anchor:links}Links
511h2. {anchor:explicit}Explicit
513Just a [URL|/url/].
515[URL and title|/url/].
517[URL and title|/url/].
519[URL and title|/url/].
521[URL and title|/url/]
523[URL and title|/url/]
525[with\_underscore|/url/with_underscore]
527[Email link|mailto:nobody@nowhere.net]
529[Empty|].
531h2. {anchor:reference}Reference
533Foo [bar|/url/].
535With [embedded \[brackets\]|/url/].
537[b|/url/] by itself should be a link.
539Indented [once|/url].
541Indented [twice|/url].
543Indented [thrice|/url].
545This should \[not\]\[\] be a link.
547{code}
548[not]: /url
549{code}
551Foo [bar|/url/].
553Foo [biz|/url/].
555h2. {anchor:with-ampersands}With ampersands
557Here’s a [link with an ampersand in the URL|http://example.com/?foo=1&bar=2].
559Here’s a link with an amersand in the link text: [AT&T|http://att.com/].
561Here’s an [inline link|/script?foo=1&bar=2].
563Here’s an [inline link in pointy braces|/script?foo=1&bar=2].
565h2. {anchor:autolinks}Autolinks
567With an ampersand: [http://example.com/?foo=1&bar=2|http://example.com/?foo=1&bar=2]
569* In a list?
570* [http://example.com/|http://example.com/]
571* It should.
573An e\-mail address: [nobody@nowhere.net|mailto:nobody@nowhere.net]
575bq. Blockquoted: [http://example.com/|http://example.com/]
577Auto\-links should not occur here: {{<http://example.com/>}}
579{code}
580or here: <http://example.com/>
581{code}
583----
585h1. {anchor:images}Images
587From "Voyage dans la Lune" by Georges Melies (1902):
589!lalune.jpg!
591Here is a movie !movie.jpg! icon.
593----
595h1. {anchor:footnotes}Footnotes
597Here 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]
599bq. Notes can go in quotes.[4]
601# And in list items.[5]
603This paragraph should not be part of the note, as it is not indented.
606[1] Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
609[2] Here’s the long note. This one contains multiple blocks.
611Subsequent blocks are indented to show that they belong to the footnote (as with list items).
613{code}
614 { <code> }
615{code}
617If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
620[3] This is _easier_ to type. Inline notes may contain [links|http://google.com] and {{]}} verbatim characters, as well as \[bracketed text\].
623[4] In quote.
626[5] In list.