git.iko.soy/typeable/pandoc
on dark-mode help sign in
typeable/pandoc/test/writer.dokuwiki
649 lines 11 kB history raw
1This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.
4----
6====== Headers ======
8===== Level 2 with an embedded link =====
10==== Level 3 with emphasis ====
12=== Level 4 ===
14== Level 5 ==
16====== Level 1 ======
18===== Level 2 with emphasis =====
20==== Level 3 ====
22with no blank line
24===== Level 2 =====
26with no blank line
29----
31====== Paragraphs ======
33Here’s a regular paragraph.
35In 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.
37Here’s one with a bullet. * criminey.
39There should be a hard line break\\
40here.
43----
45====== Block Quotes ======
47E-mail style:
49> This is a block quote. It is pretty short.
51<HTML><blockquote>
52Code in a block quote:
54<code>
55sub status {
56 print "working";
58</code>
60A list:
62 - item one
63 - item two
65Nested block quotes:
67> nested
69> nested
70</blockquote></HTML>
71This should not be a block quote: 2 > 1.
73And a following paragraph.
76----
78====== Code Blocks ======
80Code:
82<code>
83---- (should be four hyphens)
85sub status {
86 print "working";
89this code block is indented by one tab
90</code>
92And:
94<code>
95 this code block is indented by two tabs
97These should not be escaped: \$ \\ \> \[ \{
98</code>
101----
103====== Lists ======
105===== Unordered =====
107Asterisks tight:
109 * asterisk 1
110 * asterisk 2
111 * asterisk 3
113Asterisks loose:
115 * asterisk 1
116 * asterisk 2
117 * asterisk 3
119Pluses tight:
121 * Plus 1
122 * Plus 2
123 * Plus 3
125Pluses loose:
127 * Plus 1
128 * Plus 2
129 * Plus 3
131Minuses tight:
133 * Minus 1
134 * Minus 2
135 * Minus 3
137Minuses loose:
139 * Minus 1
140 * Minus 2
141 * Minus 3
143===== Ordered =====
145Tight:
147 - First
148 - Second
149 - Third
151and:
153 - One
154 - Two
155 - Three
157Loose using tabs:
159 - First
160 - Second
161 - Third
163and using spaces:
165 - One
166 - Two
167 - Three
169Multiple paragraphs:
171<HTML><ol style="list-style-type: decimal;"></HTML>
172<HTML><li></HTML><HTML><p></HTML>Item 1, graf one.<HTML></p></HTML>
173<HTML><p></HTML>Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.<HTML></p></HTML><HTML></li></HTML>
174<HTML><li></HTML><HTML><p></HTML>Item 2.<HTML></p></HTML><HTML></li></HTML>
175<HTML><li></HTML><HTML><p></HTML>Item 3.<HTML></p></HTML><HTML></li></HTML><HTML></ol></HTML>
177===== Nested =====
179 * Tab
180 * Tab
181 * Tab
183Here’s another:
185 - First
186 - Second:
187 * Fee
188 * Fie
189 * Foe
190 - Third
192Same thing but with paragraphs:
194 - First
195 - Second:
196 * Fee
197 * Fie
198 * Foe
199 - Third
201===== Tabs and spaces =====
203 * this is a list item indented with tabs
204 * this is a list item indented with spaces
205 * this is an example list item indented with tabs
206 * this is an example list item indented with spaces
208===== Fancy list markers =====
210<HTML><ol start="2" style="list-style-type: decimal;"></HTML>
211<HTML><li></HTML><HTML><p></HTML>begins with 2<HTML></p></HTML><HTML></li></HTML>
212<HTML><li></HTML><HTML><p></HTML>and now 3<HTML></p></HTML>
213<HTML><p></HTML>with a continuation<HTML></p></HTML>
214<HTML><ol start="4" style="list-style-type: lower-roman;"></HTML>
215<HTML><li></HTML>sublist with roman numerals, starting with 4<HTML></li></HTML>
216<HTML><li></HTML>more items
217<HTML><ol style="list-style-type: upper-alpha;"></HTML>
218<HTML><li></HTML>a subsublist<HTML></li></HTML>
219<HTML><li></HTML>a subsublist<HTML></li></HTML><HTML></ol></HTML>
220<HTML></li></HTML><HTML></ol></HTML>
221<HTML></li></HTML><HTML></ol></HTML>
223Nesting:
225<HTML><ol style="list-style-type: upper-alpha;"></HTML>
226<HTML><li></HTML>Upper Alpha
227<HTML><ol style="list-style-type: upper-roman;"></HTML>
228<HTML><li></HTML>Upper Roman.
229<HTML><ol start="6" style="list-style-type: decimal;"></HTML>
230<HTML><li></HTML>Decimal start with 6
231<HTML><ol start="3" style="list-style-type: lower-alpha;"></HTML>
232<HTML><li></HTML>Lower alpha with paren<HTML></li></HTML><HTML></ol></HTML>
233<HTML></li></HTML><HTML></ol></HTML>
234<HTML></li></HTML><HTML></ol></HTML>
235<HTML></li></HTML><HTML></ol></HTML>
237Autonumbering:
239 - Autonumber.
240 - More.
241 - Nested.
243Should not be a list item:
245M.A. 2007
247B. Williams
250----
252====== Definition Lists ======
254Tight using spaces:
256 * **apple** red fruit
257 * **orange** orange fruit
258 * **banana** yellow fruit
260Tight using tabs:
262 * **apple** red fruit
263 * **orange** orange fruit
264 * **banana** yellow fruit
266Loose:
268 * **apple** red fruit
269 * **orange** orange fruit
270 * **banana** yellow fruit
272Multiple blocks with italics:
274<HTML><dl></HTML>
275<HTML><dt></HTML>//apple//<HTML></dt></HTML>
276<HTML><dd></HTML><HTML><p></HTML>red fruit<HTML></p></HTML>
277<HTML><p></HTML>contains seeds, crisp, pleasant to taste<HTML></p></HTML><HTML></dd></HTML>
278<HTML><dt></HTML>//orange//<HTML></dt></HTML>
279<HTML><dd></HTML><HTML><p></HTML>orange fruit<HTML></p></HTML>
280<code>
281{ orange code block }
282</code>
284> <HTML><p></HTML>orange block quote<HTML></p></HTML>
285<HTML></dd></HTML><HTML></dl></HTML>
287Multiple definitions, tight:
289 * **apple** red fruitcomputer
290 * **orange** orange fruitbank
292Multiple definitions, loose:
294 * **apple** red fruitcomputer
295 * **orange** orange fruitbank
297Blank line after term, indented marker, alternate markers:
299 * **apple** red fruitcomputer
300 * **orange** orange fruit
301 - sublist
302 - sublist
304====== HTML Blocks ======
306Simple block on one line:
308foo
310And nested without indentation:
312foo
316bar
319Interpreted markdown in a table:
321<HTML>
322<table>
323<tr>
324<td>
325</HTML>
326This is //emphasized//
327<HTML>
328</td>
329<td>
330</HTML>
331And this is **strong**
332<HTML>
333</td>
334</tr>
335</table>
336<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
337</HTML>
338Here’s a simple block:
340foo
343This should be a code block, though:
345<code>
346<div>
347 foo
348</div>
349</code>
351As should this:
353<code>
354<div>foo</div>
355</code>
357Now, nested:
359foo
363This should just be an HTML comment:
365<HTML>
366<!-- Comment -->
367</HTML>
368Multiline:
370<HTML>
371<!--
372Blah
373Blah
374-->
375<!--
376 This is another comment.
377-->
378</HTML>
379Code block:
381<code>
382<!-- Comment -->
383</code>
385Just plain comment, with trailing spaces on the line:
387<HTML>
388<!-- foo -->
389</HTML>
390Code:
392<code>
393<hr />
394</code>
396Hr’s:
398<HTML>
399<hr>
400<hr />
401<hr />
402<hr>
403<hr />
404<hr />
405<hr class="foo" id="bar" />
406<hr class="foo" id="bar" />
407<hr class="foo" id="bar">
408</HTML>
410----
412====== Inline Markup ======
414This is //emphasized//, and so //is this//.
416This is **strong**, and so **is this**.
418An //[[url|emphasized link]]//.
420**//This is strong and em.//**
422So is **//this//** word.
424**//This is strong and em.//**
426So is **//this//** word.
428This is code: ''%%>%%'', ''%%$%%'', ''%%\%%'', ''%%\$%%'', ''%%<html>%%''.
430<del>This is //strikeout//.</del>
432Superscripts: a<sup>bc</sup>d a<sup>//hello//</sup> a<sup>hello there</sup>.
434Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.
436These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
439----
441====== Smart quotes, ellipses, dashes ======
443“Hello,” said the spider. “‘Shelob’ is my name.”
445‘A’, ‘B’, and ‘C’ are letters.
447‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’
449‘He said, “I want to go.”’ Were you alive in the 70’s?
451Here is some quoted ‘''%%code%%''’ and a “[[http://example.com/?foo=1&bar=2|quoted link]]”.
453Some dashes: one—two — three—four — five.
455Dashes between numbers: 5–7, 255–66, 1987–1999.
457Ellipses…and…and….
460----
462====== LaTeX ======
464 *
465 * $2+2=4$
466 * $x \in y$
467 * $\alpha \wedge \omega$
468 * $223$
469 * $p$-Tree
470 * Here’s some display math: $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
471 * Here’s one that has a line break in it: $\alpha + \omega \times x^2$.
473These shouldn’t be math:
475 * To get the famous equation, write ''%%$e = mc^2$%%''.
476 * $22,000 is a //lot// of money. So is $34,000. (It worked if “lot” is emphasized.)
477 * Shoes ($20) and socks ($5).
478 * Escaped ''%%$%%'': $73 //this should be emphasized// 23$.
480Here’s a LaTeX table:
484----
486====== Special Characters ======
488Here is some unicode:
490 * I hat: Î
491 * o umlaut: ö
492 * section: §
493 * set membership: ∈
494 * copyright: ©
496AT&T has an ampersand in their name.
498AT&T is another way to write it.
500This & that.
5024 < 5.
5046 > 5.
506Backslash: \
508Backtick: `
510Asterisk: *
512Underscore: _
514Left brace: {
516Right brace: }
518Left bracket: [
520Right bracket: ]
522Left paren: (
524Right paren: )
526Greater-than: >
528Hash: #
530Period: .
532Bang: !
534Plus: +
536Minus: -
539----
541====== Links ======
543===== Explicit =====
545Just a [[url/|URL]].
547[[url/|URL and title]].
549[[url/|URL and title]].
551[[url/|URL and title]].
553[[url/|URL and title]]
555[[url/|URL and title]]
557[[url/with_underscore|with_underscore]]
559[[mailto:nobody@nowhere.net|Email link]]
561[[|Empty]].
563===== Reference =====
565Foo [[url/|bar]].
567With [[url/|embedded [brackets]]].
569[[url/|b]] by itself should be a link.
571Indented [[url|once]].
573Indented [[url|twice]].
575Indented [[url|thrice]].
577This should [not][] be a link.
579<code>
580[not]: /url
581</code>
583Foo [[url/|bar]].
585Foo [[url/|biz]].
587===== With ampersands =====
589Here’s a [[http://example.com/?foo=1&bar=2|link with an ampersand in the URL]].
591Here’s a link with an amersand in the link text: [[http://att.com/|AT&T]].
593Here’s an [[script?foo=1&bar=2|inline link]].
595Here’s an [[script?foo=1&bar=2|inline link in pointy braces]].
597===== Autolinks =====
599With an ampersand: http://example.com/?foo=1&bar=2
601 * In a list?
602 * http://example.com/
603 * It should.
605An e-mail address: <nobody@nowhere.net>
607> Blockquoted: http://example.com/
609Auto-links should not occur here: ''%%<http://example.com/>%%''
611<code>
612or here: <http://example.com/>
613</code>
616----
618====== Images ======
620From “Voyage dans la Lune” by Georges Melies (1902):
622{{lalune.jpg|Voyage dans la Lune lalune}}
624Here is a movie {{movie.jpg|movie}} icon.
627----
629====== Footnotes ======
631Here is a footnote reference,((Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
632)) and another.((Here’s the long note. This one contains multiple blocks.
634Subsequent blocks are indented to show that they belong to the footnote (as with list items).
636<code>
637 { <code> }
638</code>
640If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
641)) This should //not// be a footnote reference, because it contains a space.[^my note] Here is an inline note.((This is //easier// to type. Inline notes may contain [[http://google.com|links]] and ''%%]%%'' verbatim characters, as well as [bracketed text].
642))
644> Notes can go in quotes.((In quote.
645> ))
647 - And in list items.((In list.))
649This paragraph should not be part of the note, as it is not indented.