git.iko.soy/typeable/pandoc
on 2.4 help sign in
typeable/pandoc/test/writer.textile
719 lines 10 kB history raw
1This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.
3<hr />
5h1(#headers). Headers
7h2(#level-2-with-an-embedded-link). Level 2 with an "embedded link":/url
9h3(#level-3-with-emphasis). Level 3 with _emphasis_
11h4(#level-4). Level 4
13h5(#level-5). Level 5
15h1(#level-1). Level 1
17h2(#level-2-with-emphasis). Level 2 with _emphasis_
19h3(#level-3). Level 3
21with no blank line
23h2(#level-2). Level 2
25with no blank line
27<hr />
29h1(#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&#45;wrapped line in the middle of a paragraph looked like a list item.
35Here's one with a bullet. &#42; criminey.
37There should be a hard line break
38here.
40<hr />
42h1(#block-quotes). Block Quotes
44E&#45;mail style:
46bq. This is a block quote. It is pretty short.
50<blockquote>
52Code in a block quote:
54bc. sub status {
55 print "working";
59A list:
61# item one
62# item two
64Nested block quotes:
66bq. nested
70bq. nested
74</blockquote>
76This should not be a block quote: 2 &gt; 1.
78And a following paragraph.
80<hr />
82h1(#code-blocks). Code Blocks
84Code:
86<pre>
87---- (should be four hyphens)
89sub status {
90 print &quot;working&quot;;
93this code block is indented by one tab
94</pre>
96And:
98<pre>
99 this code block is indented by two tabs
101These should not be escaped: \$ \\ \&gt; \[ \{
102</pre>
104<hr />
106h1(#lists). Lists
108h2(#unordered). Unordered
110Asterisks tight:
112* asterisk 1
113* asterisk 2
114* asterisk 3
116Asterisks loose:
118* asterisk 1
119* asterisk 2
120* asterisk 3
122Pluses tight:
124* Plus 1
125* Plus 2
126* Plus 3
128Pluses loose:
130* Plus 1
131* Plus 2
132* Plus 3
134Minuses tight:
136* Minus 1
137* Minus 2
138* Minus 3
140Minuses loose:
142* Minus 1
143* Minus 2
144* Minus 3
146h2(#ordered). Ordered
148Tight:
150# First
151# Second
152# Third
154and:
156# One
157# Two
158# Three
160Loose using tabs:
162# First
163# Second
164# Third
166and using spaces:
168# One
169# Two
170# Three
172Multiple paragraphs:
174<ol style="list-style-type: decimal;">
175<li><p>Item 1, graf one.</p>
176<p>Item 1. graf two. The quick brown fox jumped over the lazy dog's back.</p></li>
177<li><p>Item 2.</p></li>
178<li><p>Item 3.</p></li>
179</ol>
181h2(#nested). Nested
183* Tab
184** Tab
185*** Tab
187Here's another:
189# First
190# Second:
191#* Fee
192#* Fie
193#* Foe
194# Third
196Same thing but with paragraphs:
198# First
199# Second:
200#* Fee
201#* Fie
202#* Foe
203# Third
205h2(#tabs-and-spaces). Tabs and spaces
207* this is a list item indented with tabs
208* this is a list item indented with spaces
209** this is an example list item indented with tabs
210** this is an example list item indented with spaces
212h2(#fancy-list-markers). Fancy list markers
214<ol start="2" style="list-style-type: decimal;">
215<li>begins with 2</li>
216<li><p>and now 3</p>
217<p>with a continuation</p>
218<ol start="4" style="list-style-type: lower-roman;">
219<li>sublist with roman numerals, starting with 4</li>
220<li>more items
221<ol style="list-style-type: upper-alpha;">
222<li>a subsublist</li>
223<li>a subsublist</li>
224</ol>
225</li>
226</ol>
227</li>
228</ol>
230Nesting:
232<ol style="list-style-type: upper-alpha;">
233<li>Upper Alpha
234<ol style="list-style-type: upper-roman;">
235<li>Upper Roman.
236<ol start="6" style="list-style-type: decimal;">
237<li>Decimal start with 6
238<ol start="3" style="list-style-type: lower-alpha;">
239<li>Lower alpha with paren</li>
240</ol>
241</li>
242</ol>
243</li>
244</ol>
245</li>
246</ol>
248Autonumbering:
250# Autonumber.
251# More.
252## Nested.
254Should not be a list item:
256M.A. 2007
258B. Williams
260<hr />
262h1(#definition-lists). Definition Lists
264Tight using spaces:
266<dl>
267<dt>apple</dt>
268<dd>red fruit</dd>
269<dt>orange</dt>
270<dd>orange fruit</dd>
271<dt>banana</dt>
272<dd>yellow fruit</dd>
273</dl>
275Tight using tabs:
277<dl>
278<dt>apple</dt>
279<dd>red fruit</dd>
280<dt>orange</dt>
281<dd>orange fruit</dd>
282<dt>banana</dt>
283<dd>yellow fruit</dd>
284</dl>
286Loose:
288<dl>
289<dt>apple</dt>
290<dd><p>red fruit</p></dd>
291<dt>orange</dt>
292<dd><p>orange fruit</p></dd>
293<dt>banana</dt>
294<dd><p>yellow fruit</p></dd>
295</dl>
297Multiple blocks with italics:
299<dl>
300<dt>_apple_</dt>
301<dd><p>red fruit</p>
302<p>contains seeds, crisp, pleasant to taste</p></dd>
303<dt>_orange_</dt>
304<dd><p>orange fruit</p>
305bc. { orange code block }
308bq. <p>orange block quote</p>
310</dd>
311</dl>
313Multiple definitions, tight:
315<dl>
316<dt>apple</dt>
317<dd>red fruit</dd>
318<dd>computer</dd>
319<dt>orange</dt>
320<dd>orange fruit</dd>
321<dd>bank</dd>
322</dl>
324Multiple definitions, loose:
326<dl>
327<dt>apple</dt>
328<dd><p>red fruit</p></dd>
329<dd><p>computer</p></dd>
330<dt>orange</dt>
331<dd><p>orange fruit</p></dd>
332<dd><p>bank</p></dd>
333</dl>
335Blank line after term, indented marker, alternate markers:
337<dl>
338<dt>apple</dt>
339<dd><p>red fruit</p></dd>
340<dd><p>computer</p></dd>
341<dt>orange</dt>
342<dd><p>orange fruit</p>
343<ol style="list-style-type: decimal;">
344<li>sublist</li>
345<li>sublist</li>
346</ol>
347</dd>
348</dl>
350h1(#html-blocks). HTML Blocks
352Simple block on one line:
354<div>
356foo
358</div>
360And nested without indentation:
362<div>
364<div>
366<div>
368foo
371</div>
374</div>
376<div>
378bar
380</div>
383</div>
385Interpreted markdown in a table:
387<table>
388<tr>
389<td>
390This is _emphasized_
391</td>
392<td>
393And this is *strong*
394</td>
395</tr>
396</table>
397<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
398Here's a simple block:
400<div>
402foo
405</div>
407This should be a code block, though:
409bc. <div>
410 foo
411</div>
414As should this:
416bc. <div>foo</div>
419Now, nested:
421<div>
423<div>
425<div>
427foo
429</div>
432</div>
435</div>
437This should just be an HTML comment:
439<!-- Comment -->
440Multiline:
442<!--
443Blah
444Blah
445-->
446<!--
447 This is another comment.
448-->
449Code block:
451bc. <!-- Comment -->
454Just plain comment, with trailing spaces on the line:
456<!-- foo -->
457Code:
459bc. <hr />
462Hr's:
464<hr>
465<hr />
466<hr />
467<hr>
468<hr />
469<hr />
470<hr class="foo" id="bar" />
471<hr class="foo" id="bar" />
472<hr class="foo" id="bar">
473<hr />
475h1(#inline-markup). Inline Markup
477This is _emphasized_, and so _is this_.
479This is *strong*, and so *is this*.
481An _"emphasized link":/url_.
483*_This is strong and em._*
485So is *_this_* word.
487*_This is strong and em._*
489So is *_this_* word.
491This is code: @>@, @$@, @\@, @\$@, @<html>@.
493-This is _strikeout_.-
495Superscripts: a[^bc^]d a[^_hello_^] a[^hello there^].
497Subscripts: H[~2~]O, H[~23~]O, H[~many of them~]O.
499These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
501<hr />
503h1(#smart-quotes-ellipses-dashes). Smart quotes, ellipses, dashes
505"Hello," said the spider. "'Shelob' is my name."
507'A', 'B', and 'C' are letters.
509'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
511'He said, "I want to go."' Were you alive in the 70's?
513Here is some quoted '@code@' and a ""quoted link":http://example.com/?foo=1&bar=2".
515Some dashes: one -- two -- three -- four -- five.
517Dashes between numbers: 5 - 7, 255 - 66, 1987 - 1999.
519Ellipses...and...and....
521<hr />
523h1(#latex). LaTeX
525*
526* <span class="math">2+2=4</math>
527* <span class="math">x \in y</math>
528* <span class="math">\alpha \wedge \omega</math>
529* <span class="math">223</math>
530* <span class="math">p</math>&#45;Tree
531* Here's some display math: <span class="math">\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}</math>
532* Here's one that has a line break in it: <span class="math">\alpha + \omega \times x^2</math>.
534These shouldn't be math:
536* To get the famous equation, write @$e = mc^2$@.
537* $22,000 is a _lot_ of money. So is $34,000. (It worked if "lot" is emphasized.)
538* Shoes ($20) and socks ($5).
539* Escaped @$@: $73 _this should be emphasized_ 23$.
541Here's a LaTeX table:
544<hr />
546h1(#special-characters). Special Characters
548Here is some unicode:
550* I hat: Î
551* o umlaut: ö
552* section: §
553* set membership: ∈
554* copyright: ©
556AT&amp;T has an ampersand in their name.
558AT&amp;T is another way to write it.
560This &amp; that.
5624 &lt; 5.
5646 &gt; 5.
566Backslash: \
568Backtick: `
570Asterisk: &#42;
572Underscore: &#95;
574Left brace: {
576Right brace: }
578Left bracket: [
580Right bracket: ]
582Left paren: (
584Right paren: )
586Greater&#45;than: &gt;
588Hash: #
590Period: .
592Bang: !
594Plus: &#43;
596Minus: &#45;
598<hr />
600h1(#links). Links
602h2(#explicit). Explicit
604Just a "URL":/url/.
606"URL and title":/url/.
608"URL and title":/url/.
610"URL and title":/url/.
612"URL and title":/url/
614"URL and title":/url/
616"with&#95;underscore":/url/with_underscore
618"Email link":mailto:nobody@nowhere.net
620"Empty":.
622h2(#reference). Reference
624Foo "bar":/url/.
626With "embedded [brackets]":/url/.
628"b":/url/ by itself should be a link.
630Indented "once":/url.
632Indented "twice":/url.
634Indented "thrice":/url.
636This should [not][] be a link.
638bc. [not]: /url
641Foo "bar":/url/.
643Foo "biz":/url/.
645h2(#with-ampersands). With ampersands
647Here's a "link with an ampersand in the URL":http://example.com/?foo=1&bar=2.
649Here's a link with an amersand in the link text: "AT&amp;T":http://att.com/.
651Here's an "inline link":/script?foo=1&bar=2.
653Here's an "inline link in pointy braces":/script?foo=1&bar=2.
655h2(#autolinks). Autolinks
657With an ampersand: "$":http://example.com/?foo=1&bar=2
659* In a list?
660* "$":http://example.com/
661* It should.
663An e&#45;mail address: "(email)nobody&#64;nowhere.net":mailto:nobody@nowhere.net
665bq. Blockquoted: "$":http://example.com/
669Auto&#45;links should not occur here: @<http://example.com/>@
671bc. or here: <http://example.com/>
674<hr />
676h1(#images). Images
678From "Voyage dans la Lune" by Georges Melies (1902):
680!lalune.jpg(Voyage dans la Lune)!
681lalune
683Here is a movie !movie.jpg(movie)! icon.
685<hr />
687h1(#footnotes). Footnotes
689Here 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]
691bq. Notes can go in quotes.[4]
695# And in list items.[5]
697This paragraph should not be part of the note, as it is not indented.
700fn1. Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
703fn2. Here's the long note. This one contains multiple blocks.
705Subsequent blocks are indented to show that they belong to the footnote (as with list items).
707bc. { <code> }
710If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
713fn3. This is _easier_ to type. Inline notes may contain "links":http://google.com and @]@ verbatim characters, as well as [bracketed text].
716fn4. In quote.
719fn5. In list.