git.iko.soy/typeable/pandoc
on dark-mode help sign in
typeable/pandoc/test/writer.jira
537 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{quote}
49This should not be a block quote: 2 > 1.
51And a following paragraph.
53----
54h1. {anchor:code-blocks}Code Blocks
55Code:
57{noformat}
58---- (should be four hyphens)
60sub status {
61 print "working";
64this code block is indented by one tab{noformat}
65And:
67{noformat}
68 this code block is indented by two tabs
70These should not be escaped: \$ \\ \> \[ \{{noformat}
71----
72h1. {anchor:lists}Lists
73h2. {anchor:unordered}Unordered
74Asterisks tight:
76* asterisk 1
77* asterisk 2
78* asterisk 3
80Asterisks loose:
82* asterisk 1
83* asterisk 2
84* asterisk 3
86Pluses tight:
88* Plus 1
89* Plus 2
90* Plus 3
92Pluses loose:
94* Plus 1
95* Plus 2
96* Plus 3
98Minuses tight:
100* Minus 1
101* Minus 2
102* Minus 3
104Minuses loose:
106* Minus 1
107* Minus 2
108* Minus 3
110h2. {anchor:ordered}Ordered
111Tight:
113# First
114# Second
115# Third
117and:
119# One
120# Two
121# Three
123Loose using tabs:
125# First
126# Second
127# Third
129and using spaces:
131# One
132# Two
133# Three
135Multiple paragraphs:
137# Item 1, graf one.
138Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.
139# Item 2.
140# Item 3.
142h2. {anchor:nested}Nested
143* Tab
144** Tab
145*** Tab
147Here’s another:
149# First
150# Second:
151#* Fee
152#* Fie
153#* Foe
154# Third
156Same thing but with paragraphs:
158# First
159# Second:
160#* Fee
161#* Fie
162#* Foe
163# Third
165h2. {anchor:tabs-and-spaces}Tabs and spaces
166* this is a list item indented with tabs
167* this is a list item indented with spaces
168** this is an example list item indented with tabs
169** this is an example list item indented with spaces
171h2. {anchor:fancy-list-markers}Fancy list markers
172# begins with 2
173# and now 3
174with a continuation
175## sublist with roman numerals, starting with 4
176## more items
177### a subsublist
178### a subsublist
180Nesting:
182# Upper Alpha
183## Upper Roman.
184### Decimal start with 6
185#### Lower alpha with paren
187Autonumbering:
189# Autonumber.
190# More.
191## Nested.
193Should not be a list item:
195M.A. 2007
197B. Williams
199----
200h1. {anchor:definition-lists}Definition Lists
201Tight using spaces:
203* *apple*
204red fruit
205* *orange*
206orange fruit
207* *banana*
208yellow fruit
210Tight using tabs:
212* *apple*
213red fruit
214* *orange*
215orange fruit
216* *banana*
217yellow fruit
219Loose:
221* *apple*
222red fruit
223* *orange*
224orange fruit
225* *banana*
226yellow fruit
228Multiple blocks with italics:
230* *_apple_*
231red fruit
232contains seeds, crisp, pleasant to taste
233* *_orange_*
234orange fruit
235{noformat}
236{ orange code block }{noformat}
237bq. orange block quote
239Multiple definitions, tight:
241* *apple*
242red fruit
243computer
244* *orange*
245orange fruit
246bank
248Multiple definitions, loose:
250* *apple*
251red fruit
252computer
253* *orange*
254orange fruit
255bank
257Blank line after term, indented marker, alternate markers:
259* *apple*
260red fruit
261computer
262* *orange*
263orange fruit
264*# sublist
265*# sublist
267h1. {anchor:html-blocks}HTML Blocks
268Simple block on one line:
270foo
272And nested without indentation:
274foo
276bar
278Interpreted markdown in a table:
280This is _emphasized_
282And this is *strong*
284Here’s a simple block:
286foo
288This should be a code block, though:
290{noformat}
291<div>
292 foo
293</div>{noformat}
294As should this:
296{noformat}
297<div>foo</div>{noformat}
298Now, nested:
300foo
302This should just be an HTML comment:
304Multiline:
306Code block:
308{noformat}
309<!-- Comment -->{noformat}
310Just plain comment, with trailing spaces on the line:
312Code:
314{noformat}
315<hr />{noformat}
316Hr’s:
318----
319h1. {anchor:inline-markup}Inline Markup
320This is _emphasized_, and so _is this_.
322This is *strong*, and so *is this*.
324An _[emphasized link|/url]_.
326*_This is strong and em._*
328So is *_this_* word.
330*_This is strong and em._*
332So is *_this_* word.
334This is code: {{>}}, {{$}}, {{&bsol;}}, {{&bsol;$}}, {{<html>}}.
336-This is _strikeout_.-
338Superscripts: a{^}bc{^}d a{^}_hello_{^} a{^}hello there{^}.
340Subscripts: H{~}2{~}O, H{~}23{~}O, H{~}many of them{~}O.
342These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
344----
345h1. {anchor:smart-quotes-ellipses-dashes}Smart quotes, ellipses, dashes
346"Hello," said the spider. "'Shelob' is my name."
348'A', 'B', and 'C' are letters.
350'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
352'He said, "I want to go."' Were you alive in the 70’s?
354Here is some quoted '{{code}}' and a "[quoted link|http://example.com/?foo=1&bar=2]".
356Some dashes: one—two — three—four — five.
358Dashes between numbers: 5–7, 255–66, 1987–1999.
360Ellipses…and…and….
362----
363h1. {anchor:latex}LaTeX
364*
365* 2 + 2 = 4
366* _x_ ∈ {_}y{_}
367* _α_ ∧ {_}ω{_}
368* 223
369* _p_\-Tree
370* Here’s some display math:
371$$\frac\{d\}\{dx\}f\(x)=\lim\_\{h\to 0\}&bsol;frac\{f(x+h)-f\(x)\}\{h\}$$
373* Here’s one that has a line break in it: _α_ + {_}ω{_} × {_}x{_}^2^.
375These shouldn’t be math:
377* To get the famous equation, write {{$e = mc^2$}}.
378* $22,000 is a _lot_ of money. So is $34,000. \(It worked if "lot" is emphasized.)
379* Shoes \($20) and socks \($5).
380* Escaped {{$}}: $73 _this should be emphasized_ 23$.
382Here’s a LaTeX table:
384----
385h1. {anchor:special-characters}Special Characters
386Here is some unicode:
388* I hat: Î
389* o umlaut: ö
390* section: §
391* set membership: ∈
392* copyright: ©
394AT&T has an ampersand in their name.
396AT&T is another way to write it.
398This & that.
4004 < 5.
4026 > 5.
404Backslash: &bsol;
406Backtick: `
408Asterisk: \*
410Underscore: \_
412Left brace: \{
414Right brace: \}
416Left bracket: \[
418Right bracket: \]
420Left paren: \(
422Right paren: )
424Greater-than: >
426Hash: #
428Period: .
430Bang: \!
432Plus: \+
434Minus: \-
436----
437h1. {anchor:links}Links
438h2. {anchor:explicit}Explicit
439Just a [URL|/url/].
441[URL and title|/url/].
443[URL and title|/url/].
445[URL and title|/url/].
447[URL and title|/url/]
449[URL and title|/url/]
451[with_underscore|/url/with_underscore]
453[Email link|mailto:nobody@nowhere.net]
455[Empty|].
457h2. {anchor:reference}Reference
458Foo [bar|/url/].
460With [embedded \[brackets\]|/url/].
462[b|/url/] by itself should be a link.
464Indented [once|/url].
466Indented [twice|/url].
468Indented [thrice|/url].
470This should \[not\]\[\] be a link.
472{noformat}
473[not]: /url{noformat}
474Foo [bar|/url/].
476Foo [biz|/url/].
478h2. {anchor:with-ampersands}With ampersands
479Here’s a [link with an ampersand in the URL|http://example.com/?foo=1&bar=2].
481Here’s a link with an amersand in the link text: [AT&T|http://att.com/].
483Here’s an [inline link|/script?foo=1&bar=2].
485Here’s an [inline link in pointy braces|/script?foo=1&bar=2].
487h2. {anchor:autolinks}Autolinks
488With an ampersand: [http://example.com/?foo=1&bar=2]
490* In a list?
491* [http://example.com/]
492* It should.
494An e-mail address: [mailto:nobody@nowhere.net]
496bq. Blockquoted: [http://example.com/]
497Auto-links should not occur here: {{<http://example.com/>}}
499{noformat}
500or here: <http://example.com/>{noformat}
501----
502h1. {anchor:images}Images
503From "Voyage dans la Lune" by Georges Melies \(1902):
505!lalune.jpg|title=fig:Voyage dans la Lune, alt=lalune!
507Here is a movie !movie.jpg|alt=movie! icon.
509----
510h1. {anchor:footnotes}Footnotes
511Here 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]
513bq. Notes can go in quotes.[4]
514# And in list items.[5]
516This paragraph should not be part of the note, as it is not indented.
519\[1] Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
522\[2] Here’s the long note. This one contains multiple blocks.
524Subsequent blocks are indented to show that they belong to the footnote \(as with list items).
526{noformat}
527 { <code> }{noformat}
528If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
531\[3] This is _easier_ to type. Inline notes may contain [links|http://google.com] and {{\]}} verbatim characters, as well as \[bracketed text].
534\[4] In quote.
537\[5] In list.