git.iko.soy/typeable/pandoc
on 1.10.0.4 help sign in
typeable/pandoc/tests/writer.textile
716 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-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-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>
355foo
356</div>
358And nested without indentation:
360<div>
361<div>
362<div>
363foo
364</div>
365</div>
366<div>
367bar
368</div>
369</div>
371Interpreted markdown in a table:
373<table>
374<tr>
375<td>
376This is _emphasized_
377</td>
378<td>
379And this is *strong*
380</td>
381</tr>
382</table>
384<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
386Here's a simple block:
388<div>
390foo
391</div>
393This should be a code block, though:
395bc. <div>
396 foo
397</div>
400As should this:
402bc. <div>foo</div>
405Now, nested:
407<div>
408 <div>
409 <div>
411foo
412</div>
413 </div>
414</div>
416This should just be an HTML comment:
418<!-- Comment -->
420Multiline:
422<!--
423Blah
424Blah
425-->
427<!--
428 This is another comment.
429-->
431Code block:
433bc. <!-- Comment -->
436Just plain comment, with trailing spaces on the line:
438<!-- foo -->
440Code:
442bc. <hr />
445Hr's:
447<hr>
449<hr />
451<hr />
453<hr>
455<hr />
457<hr />
459<hr class="foo" id="bar" />
461<hr class="foo" id="bar" />
463<hr class="foo" id="bar">
465<hr />
467h1(#inline-markup). Inline Markup
469This is _emphasized_, and so _is this_.
471This is *strong*, and so *is this*.
473An _"emphasized link":/url_.
475*_This is strong and em._*
477So is *_this_* word.
479*_This is strong and em._*
481So is *_this_* word.
483This is code: @>@, @$@, @\@, @\$@, @<html>@.
485-This is _strikeout_.-
487Superscripts: a[^bc^]d a[^_hello_^] a[^hello there^].
489Subscripts: H[~2~]O, H[~23~]O, H[~many of them~]O.
491These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
493<hr />
495h1(#smart-quotes-ellipses-dashes). Smart quotes, ellipses, dashes
497"Hello," said the spider. "'Shelob' is my name."
499'A', 'B', and 'C' are letters.
501'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
503'He said, "I want to go."' Were you alive in the 70's?
505Here is some quoted '@code@' and a ""quoted link":http://example.com/?foo=1&bar=2".
507Some dashes: one -- two -- three -- four -- five.
509Dashes between numbers: 5 - 7, 255 - 66, 1987 - 1999.
511Ellipses...and...and....
513<hr />
515h1(#latex). LaTeX
517*
518* <span class="math">2+2=4</math>
519* <span class="math">x \in y</math>
520* <span class="math">\alpha \wedge \omega</math>
521* <span class="math">223</math>
522* <span class="math">p</math>-Tree
523* 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>
524* Here's one that has a line break in it: <span class="math">\alpha + \omega \times x^2</math>.
526These shouldn't be math:
528* To get the famous equation, write @$e = mc^2$@.
529* $22,000 is a _lot_ of money. So is $34,000. (It worked if "lot" is emphasized.)
530* Shoes ($20) and socks ($5).
531* Escaped @$@: $73 _this should be emphasized_ 23$.
533Here's a LaTeX table:
536<hr />
538h1(#special-characters). Special Characters
540Here is some unicode:
542* I hat: Î
543* o umlaut: ö
544* section: §
545* set membership: ∈
546* copyright: ©
548AT&amp;T has an ampersand in their name.
550AT&amp;T is another way to write it.
552This &amp; that.
5544 &lt; 5.
5566 &gt; 5.
558Backslash: \
560Backtick: `
562Asterisk: &#42;
564Underscore: &#95;
566Left brace: {
568Right brace: }
570Left bracket: [
572Right bracket: ]
574Left paren: (
576Right paren: )
578Greater-than: &gt;
580Hash: #
582Period: .
584Bang: !
586Plus: +
588Minus: -
590<hr />
592h1(#links). Links
594h2(#explicit). Explicit
596Just a "URL":/url/.
598"URL and title":/url/.
600"URL and title":/url/.
602"URL and title":/url/.
604"URL and title":/url/
606"URL and title":/url/
608"with&#95;underscore":/url/with_underscore
610"Email link":mailto:nobody@nowhere.net
612"Empty":.
614h2(#reference). Reference
616Foo "bar":/url/.
618Foo "bar":/url/.
620Foo "bar":/url/.
622With "embedded [brackets]":/url/.
624"b":/url/ by itself should be a link.
626Indented "once":/url.
628Indented "twice":/url.
630Indented "thrice":/url.
632This should [not][] be a link.
634bc. [not]: /url
637Foo "bar":/url/.
639Foo "biz":/url/.
641h2(#with-ampersands). With ampersands
643Here's a "link with an ampersand in the URL":http://example.com/?foo=1&bar=2.
645Here's a link with an amersand in the link text: "AT&amp;T":http://att.com/.
647Here's an "inline link":/script?foo=1&bar=2.
649Here's an "inline link in pointy braces":/script?foo=1&bar=2.
651h2(#autolinks). Autolinks
653With an ampersand: "$":http://example.com/?foo=1&bar=2
655* In a list?
656* "$":http://example.com/
657* It should.
659An e-mail address: "nobody&#64;nowhere.net":mailto:nobody@nowhere.net
661bq. Blockquoted: "$":http://example.com/
665Auto-links should not occur here: @<http://example.com/>@
667bc. or here: <http://example.com/>
670<hr />
672h1(#images). Images
674From "Voyage dans la Lune" by Georges Melies (1902):
676!lalune.jpg(Voyage dans la Lune)!
677lalune
679Here is a movie !movie.jpg(movie)! icon.
681<hr />
683h1(#footnotes). Footnotes
685Here 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]
687bq. Notes can go in quotes.[4]
691# And in list items.[5]
693This paragraph should not be part of the note, as it is not indented.
696fn1. Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
699fn2. Here's the long note. This one contains multiple blocks.
701Subsequent blocks are indented to show that they belong to the footnote (as with list items).
703bc. { <code> }
706If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
709fn3. This is _easier_ to type. Inline notes may contain "links":http://google.com and @]@ verbatim characters, as well as [bracketed text].
712fn4. In quote.
715fn5. In list.