git.iko.soy/typeable/pandoc
on commonmark-github help sign in
typeable/pandoc/test/writer.dokuwiki
638 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>
59A list:
61 - item one
62 - item two
64Nested block quotes:
66> nested
68> nested
69</blockquote></HTML>
70This should not be a block quote: 2 > 1.
72And a following paragraph.
75----
77====== 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>
90And:
92<code>
93 this code block is indented by two tabs
95These should not be escaped: \$ \\ \> \[ \{
96</code>
98----
100====== Lists ======
102===== Unordered =====
104Asterisks tight:
106 * asterisk 1
107 * asterisk 2
108 * asterisk 3
110Asterisks loose:
112 * asterisk 1
113 * asterisk 2
114 * asterisk 3
116Pluses tight:
118 * Plus 1
119 * Plus 2
120 * Plus 3
122Pluses loose:
124 * Plus 1
125 * Plus 2
126 * Plus 3
128Minuses tight:
130 * Minus 1
131 * Minus 2
132 * Minus 3
134Minuses loose:
136 * Minus 1
137 * Minus 2
138 * Minus 3
140===== Ordered =====
142Tight:
144 - First
145 - Second
146 - Third
148and:
150 - One
151 - Two
152 - Three
154Loose using tabs:
156 - First
157 - Second
158 - Third
160and using spaces:
162 - One
163 - Two
164 - Three
166Multiple paragraphs:
168<HTML><ol style="list-style-type: decimal;"></HTML>
169<HTML><li></HTML><HTML><p></HTML>Item 1, graf one.<HTML></p></HTML>
170<HTML><p></HTML>Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.<HTML></p></HTML><HTML></li></HTML>
171<HTML><li></HTML><HTML><p></HTML>Item 2.<HTML></p></HTML><HTML></li></HTML>
172<HTML><li></HTML><HTML><p></HTML>Item 3.<HTML></p></HTML><HTML></li></HTML><HTML></ol></HTML>
174===== 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
198===== 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
205===== Fancy list markers =====
207<HTML><ol start="2" style="list-style-type: decimal;"></HTML>
208<HTML><li></HTML>begins with 2<HTML></li></HTML>
209<HTML><li></HTML><HTML><p></HTML>and now 3<HTML></p></HTML>
210<HTML><p></HTML>with a continuation<HTML></p></HTML>
211<HTML><ol start="4" style="list-style-type: lower-roman;"></HTML>
212<HTML><li></HTML>sublist with roman numerals, starting with 4<HTML></li></HTML>
213<HTML><li></HTML>more items
214<HTML><ol style="list-style-type: upper-alpha;"></HTML>
215<HTML><li></HTML>a subsublist<HTML></li></HTML>
216<HTML><li></HTML>a subsublist<HTML></li></HTML><HTML></ol></HTML>
217<HTML></li></HTML><HTML></ol></HTML>
218<HTML></li></HTML><HTML></ol></HTML>
220Nesting:
222<HTML><ol style="list-style-type: upper-alpha;"></HTML>
223<HTML><li></HTML>Upper Alpha
224<HTML><ol style="list-style-type: upper-roman;"></HTML>
225<HTML><li></HTML>Upper Roman.
226<HTML><ol start="6" style="list-style-type: decimal;"></HTML>
227<HTML><li></HTML>Decimal start with 6
228<HTML><ol start="3" style="list-style-type: lower-alpha;"></HTML>
229<HTML><li></HTML>Lower alpha with paren<HTML></li></HTML><HTML></ol></HTML>
230<HTML></li></HTML><HTML></ol></HTML>
231<HTML></li></HTML><HTML></ol></HTML>
232<HTML></li></HTML><HTML></ol></HTML>
234Autonumbering:
236 - Autonumber.
237 - More.
238 - Nested.
240Should not be a list item:
242M.A. 2007
244B. Williams
247----
249====== Definition Lists ======
251Tight using spaces:
253 * **apple** red fruit
254 * **orange** orange fruit
255 * **banana** yellow fruit
257Tight using tabs:
259 * **apple** red fruit
260 * **orange** orange fruit
261 * **banana** yellow fruit
263Loose:
265 * **apple** red fruit
266 * **orange** orange fruit
267 * **banana** yellow fruit
269Multiple blocks with italics:
271<HTML><dl></HTML>
272<HTML><dt></HTML>//apple//<HTML></dt></HTML>
273<HTML><dd></HTML><HTML><p></HTML>red fruit<HTML></p></HTML>
274<HTML><p></HTML>contains seeds, crisp, pleasant to taste<HTML></p></HTML><HTML></dd></HTML>
275<HTML><dt></HTML>//orange//<HTML></dt></HTML>
276<HTML><dd></HTML><HTML><p></HTML>orange fruit<HTML></p></HTML>
277<code>
278{ orange code block }
279</code>
280> <HTML><p></HTML>orange block quote<HTML></p></HTML>
281<HTML></dd></HTML><HTML></dl></HTML>
283Multiple definitions, tight:
285 * **apple** red fruitcomputer
286 * **orange** orange fruitbank
288Multiple definitions, loose:
290 * **apple** red fruitcomputer
291 * **orange** orange fruitbank
293Blank line after term, indented marker, alternate markers:
295 * **apple** red fruitcomputer
296 * **orange** orange fruit
297 - sublist
298 - sublist
300====== HTML Blocks ======
302Simple block on one line:
304foo
306And nested without indentation:
308foo
312bar
315Interpreted markdown in a table:
317<HTML>
318<table>
319<tr>
320<td>
321</HTML>
322This is //emphasized//
323<HTML>
324</td>
325<td>
326</HTML>
327And this is **strong**
328<HTML>
329</td>
330</tr>
331</table>
332<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
333</HTML>
334Here’s a simple block:
336foo
339This should be a code block, though:
341<code>
342<div>
343 foo
344</div>
345</code>
346As should this:
348<code>
349<div>foo</div>
350</code>
351Now, nested:
353foo
357This should just be an HTML comment:
359<HTML>
360<!-- Comment -->
361</HTML>
362Multiline:
364<HTML>
365<!--
366Blah
367Blah
368-->
369<!--
370 This is another comment.
371-->
372</HTML>
373Code block:
375<code>
376<!-- Comment -->
377</code>
378Just plain comment, with trailing spaces on the line:
380<HTML>
381<!-- foo -->
382</HTML>
383Code:
385<code>
386<hr />
387</code>
388Hr’s:
390<HTML>
391<hr>
392<hr />
393<hr />
394<hr>
395<hr />
396<hr />
397<hr class="foo" id="bar" />
398<hr class="foo" id="bar" />
399<hr class="foo" id="bar">
400</HTML>
402----
404====== Inline Markup ======
406This is //emphasized//, and so //is this//.
408This is **strong**, and so **is this**.
410An //[[url|emphasized link]]//.
412**//This is strong and em.//**
414So is **//this//** word.
416**//This is strong and em.//**
418So is **//this//** word.
420This is code: ''%%>%%'', ''%%$%%'', ''%%\%%'', ''%%\$%%'', ''%%<html>%%''.
422<del>This is //strikeout//.</del>
424Superscripts: a<sup>bc</sup>d a<sup>//hello//</sup> a<sup>hello there</sup>.
426Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.
428These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
431----
433====== Smart quotes, ellipses, dashes ======
435“Hello,” said the spider. “‘Shelob’ is my name.”
437‘A’, ‘B’, and ‘C’ are letters.
439‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’
441‘He said, “I want to go.”’ Were you alive in the 70’s?
443Here is some quoted ‘''%%code%%''’ and a “[[http://example.com/?foo=1&bar=2|quoted link]]”.
445Some dashes: one—two — three—four — five.
447Dashes between numbers: 5–7, 255–66, 1987–1999.
449Ellipses…and…and….
452----
454====== LaTeX ======
456 *
457 * $2+2=4$
458 * $x \in y$
459 * $\alpha \wedge \omega$
460 * $223$
461 * $p$-Tree
462 * Here’s some display math: $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
463 * Here’s one that has a line break in it: $\alpha + \omega \times x^2$.
465These shouldn’t be math:
467 * To get the famous equation, write ''%%$e = mc^2$%%''.
468 * $22,000 is a //lot// of money. So is $34,000. (It worked if “lot” is emphasized.)
469 * Shoes ($20) and socks ($5).
470 * Escaped ''%%$%%'': $73 //this should be emphasized// 23$.
472Here’s a LaTeX table:
476----
478====== Special Characters ======
480Here is some unicode:
482 * I hat: Î
483 * o umlaut: ö
484 * section: §
485 * set membership: ∈
486 * copyright: ©
488AT&T has an ampersand in their name.
490AT&T is another way to write it.
492This & that.
4944 < 5.
4966 > 5.
498Backslash: \
500Backtick: `
502Asterisk: *
504Underscore: _
506Left brace: {
508Right brace: }
510Left bracket: [
512Right bracket: ]
514Left paren: (
516Right paren: )
518Greater-than: >
520Hash: #
522Period: .
524Bang: !
526Plus: +
528Minus: -
531----
533====== Links ======
535===== Explicit =====
537Just a [[url/|URL]].
539[[url/|URL and title]].
541[[url/|URL and title]].
543[[url/|URL and title]].
545[[url/|URL and title]]
547[[url/|URL and title]]
549[[url/with_underscore|with_underscore]]
551[[mailto:nobody@nowhere.net|Email link]]
553[[|Empty]].
555===== Reference =====
557Foo [[url/|bar]].
559With [[url/|embedded [brackets]]].
561[[url/|b]] by itself should be a link.
563Indented [[url|once]].
565Indented [[url|twice]].
567Indented [[url|thrice]].
569This should [not][] be a link.
571<code>
572[not]: /url
573</code>
574Foo [[url/|bar]].
576Foo [[url/|biz]].
578===== With ampersands =====
580Here’s a [[http://example.com/?foo=1&bar=2|link with an ampersand in the URL]].
582Here’s a link with an amersand in the link text: [[http://att.com/|AT&T]].
584Here’s an [[script?foo=1&bar=2|inline link]].
586Here’s an [[script?foo=1&bar=2|inline link in pointy braces]].
588===== Autolinks =====
590With an ampersand: http://example.com/?foo=1&bar=2
592 * In a list?
593 * http://example.com/
594 * It should.
596An e-mail address: <nobody@nowhere.net>
598> Blockquoted: http://example.com/
600Auto-links should not occur here: ''%%<http://example.com/>%%''
602<code>
603or here: <http://example.com/>
604</code>
606----
608====== Images ======
610From “Voyage dans la Lune” by Georges Melies (1902):
612{{:lalune.jpg|Voyage dans la Lune lalune}}
614Here is a movie {{:movie.jpg|movie}} icon.
617----
619====== Footnotes ======
621Here 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.
622)) and another.((Here’s the long note. This one contains multiple blocks.
624Subsequent blocks are indented to show that they belong to the footnote (as with list items).
626<code>
627 { <code> }
628</code>
629If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
630)) 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].
631))
633> Notes can go in quotes.((In quote.
634> ))
636 - And in list items.((In list.))
638This paragraph should not be part of the note, as it is not indented.