2019-11-22 16:57:24 +01:00
This is a set of tests for pandoc. Most of them are adapted from John Gruber’ s markdown test suite.
2019-06-05 23:52:23 +02:00
----
h1. {anchor:headers}Headers
h2. {anchor:level-2-with-an-embedded-link}Level 2 with an [embedded link|/url]
h3. {anchor:level-3-with-emphasis}Level 3 with _emphasis_
h4. {anchor:level-4}Level 4
h5. {anchor:level-5}Level 5
h1. {anchor:level-1}Level 1
h2. {anchor:level-2-with-emphasis}Level 2 with _emphasis_
h3. {anchor:level-3}Level 3
with no blank line
h2. {anchor:level-2}Level 2
with no blank line
----
h1. {anchor:paragraphs}Paragraphs
2019-11-22 16:57:24 +01:00
Here’ s a regular paragraph.
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
In 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.
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
Here’ s one with a bullet. * criminey.
2019-06-05 23:52:23 +02:00
There should be a hard line break
here.
----
h1. {anchor:block-quotes}Block Quotes
2019-12-20 17:12:46 +01:00
E-mail style:
2019-06-05 23:52:23 +02:00
bq. This is a block quote. It is pretty short.
{quote}
Code in a block quote:
2021-03-08 12:40:25 +01:00
{noformat}
2019-08-08 23:08:46 +02:00
sub status {
print "working";
2021-03-08 12:40:25 +01:00
}{noformat}
2019-06-05 23:52:23 +02:00
A list:
# item one
# item two
Nested block quotes:
bq. nested
2021-03-13 14:31:43 +01:00
bq. nested{quote}
2019-11-22 16:57:24 +01:00
This should not be a block quote: 2 > 1.
2019-06-05 23:52:23 +02:00
And a following paragraph.
----
h1. {anchor:code-blocks}Code Blocks
Code:
2021-03-08 12:40:25 +01:00
{noformat}
2019-08-08 23:08:46 +02:00
---- (should be four hyphens)
2019-06-05 23:52:23 +02:00
2019-08-08 23:08:46 +02:00
sub status {
print "working";
2019-06-05 23:52:23 +02:00
}
2021-03-08 12:40:25 +01:00
this code block is indented by one tab{noformat}
2019-06-05 23:52:23 +02:00
And:
2021-03-08 12:40:25 +01:00
{noformat}
2019-06-05 23:52:23 +02:00
this code block is indented by two tabs
2021-03-08 12:40:25 +01:00
These should not be escaped: \$ \\ \> \[ \{{noformat}
2019-06-05 23:52:23 +02:00
----
h1. {anchor:lists}Lists
h2. {anchor:unordered}Unordered
Asterisks tight:
* asterisk 1
* asterisk 2
* asterisk 3
Asterisks loose:
* asterisk 1
* asterisk 2
* asterisk 3
Pluses tight:
* Plus 1
* Plus 2
* Plus 3
Pluses loose:
* Plus 1
* Plus 2
* Plus 3
Minuses tight:
* Minus 1
* Minus 2
* Minus 3
Minuses loose:
* Minus 1
* Minus 2
* Minus 3
h2. {anchor:ordered}Ordered
Tight:
# First
# Second
# Third
and:
# One
# Two
# Three
Loose using tabs:
# First
# Second
# Third
and using spaces:
# One
# Two
# Three
Multiple paragraphs:
# Item 1, graf one.
2019-11-22 16:57:24 +01:00
Item 1. graf two. The quick brown fox jumped over the lazy dog’ s back.
2019-06-05 23:52:23 +02:00
# Item 2.
# Item 3.
h2. {anchor:nested}Nested
* Tab
** Tab
*** Tab
2019-11-22 16:57:24 +01:00
Here’ s another:
2019-06-05 23:52:23 +02:00
# First
# Second:
#* Fee
#* Fie
#* Foe
# Third
Same thing but with paragraphs:
# First
# Second:
#* Fee
#* Fie
#* Foe
# Third
h2. {anchor:tabs-and-spaces}Tabs and spaces
* this is a list item indented with tabs
* this is a list item indented with spaces
** this is an example list item indented with tabs
** this is an example list item indented with spaces
h2. {anchor:fancy-list-markers}Fancy list markers
# begins with 2
# and now 3
with a continuation
## sublist with roman numerals, starting with 4
## more items
### a subsublist
### a subsublist
Nesting:
# Upper Alpha
## Upper Roman.
### Decimal start with 6
#### Lower alpha with paren
Autonumbering:
# Autonumber.
# More.
## Nested.
Should not be a list item:
M.A. 2007
B. Williams
----
h1. {anchor:definition-lists}Definition Lists
Tight using spaces:
* *apple*
red fruit
* *orange*
orange fruit
* *banana*
yellow fruit
Tight using tabs:
* *apple*
red fruit
* *orange*
orange fruit
* *banana*
yellow fruit
Loose:
* *apple*
red fruit
* *orange*
orange fruit
* *banana*
yellow fruit
Multiple blocks with italics:
* *_apple_*
red fruit
contains seeds, crisp, pleasant to taste
* *_orange_*
orange fruit
2021-03-08 12:40:25 +01:00
{noformat}
{ orange code block }{noformat}
2019-06-05 23:52:23 +02:00
bq. orange block quote
Multiple definitions, tight:
* *apple*
red fruit
computer
* *orange*
orange fruit
bank
Multiple definitions, loose:
* *apple*
red fruit
computer
* *orange*
orange fruit
bank
Blank line after term, indented marker, alternate markers:
* *apple*
red fruit
computer
* *orange*
orange fruit
*# sublist
*# sublist
h1. {anchor:html-blocks}HTML Blocks
Simple block on one line:
foo
2019-12-20 17:12:46 +01:00
2019-06-05 23:52:23 +02:00
And nested without indentation:
foo
bar
2019-12-20 17:12:46 +01:00
Interpreted markdown in a table:
2019-06-05 23:52:23 +02:00
This is _emphasized_
And this is *strong*
2019-11-22 16:57:24 +01:00
Here’ s a simple block:
2019-06-05 23:52:23 +02:00
foo
This should be a code block, though:
2021-03-08 12:40:25 +01:00
{noformat}
2019-08-08 23:08:46 +02:00
<div>
2019-06-05 23:52:23 +02:00
foo
2021-03-08 12:40:25 +01:00
</div>{noformat}
2019-06-05 23:52:23 +02:00
As should this:
2021-03-08 12:40:25 +01:00
{noformat}
<div>foo</div>{noformat}
2019-06-05 23:52:23 +02:00
Now, nested:
foo
2019-12-20 17:12:46 +01:00
This should just be an HTML comment:
2019-06-05 23:52:23 +02:00
Multiline:
Code block:
2021-03-08 12:40:25 +01:00
{noformat}
<!-- Comment -->{noformat}
2019-06-05 23:52:23 +02:00
Just plain comment, with trailing spaces on the line:
Code:
2021-03-08 12:40:25 +01:00
{noformat}
<hr />{noformat}
2019-11-22 16:57:24 +01:00
Hr’ s:
2019-06-05 23:52:23 +02:00
----
h1. {anchor:inline-markup}Inline Markup
This is _emphasized_, and so _is this_.
This is *strong*, and so *is this*.
An _[emphasized link|/url]_.
*_This is strong and em._*
So is *_this_* word.
*_This is strong and em._*
So is *_this_* word.
2019-12-20 17:12:46 +01:00
This is code: {{>}}, {{$}}, {{\}}, {{\$}}, {{<html>}}.
2019-06-05 23:52:23 +02:00
-This is _strikeout_.-
2019-12-20 17:12:46 +01:00
Superscripts: a{^}bc{^}d a{^}_hello_{^} a{^}hello there{^}.
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
Subscripts: H{~}2{~}O, H{~}23{~}O, H{~}many of them{~}O.
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
2019-06-05 23:52:23 +02:00
----
h1. {anchor:smart-quotes-ellipses-dashes}Smart quotes, ellipses, dashes
"Hello," said the spider. "'Shelob' is my name."
'A', 'B', and 'C' are letters.
'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
2019-11-22 16:57:24 +01:00
'He said, "I want to go."' Were you alive in the 70’ s?
2019-06-05 23:52:23 +02:00
Here is some quoted '{{code}}' and a "[quoted link|http://example.com/?foo=1&bar=2]".
2019-12-20 17:12:46 +01:00
Some dashes: one—two — three—four — five.
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
Dashes between numbers: 5– 7, 255– 66, 1987– 1999.
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
Ellipses…and…and….
2019-06-05 23:52:23 +02:00
----
h1. {anchor:latex}LaTeX
*
2019-12-20 17:12:46 +01:00
* 2 + 2 = 4
* _x_ ∈ {_}y{_}
* _α _ ∧ {_}ω{_}
2019-06-05 23:52:23 +02:00
* 223
2019-11-22 16:57:24 +01:00
* _p_\-Tree
2019-12-20 17:12:46 +01:00
* Here’ s some display math:
2020-06-22 15:47:46 +02:00
$$\frac\{d\}\{dx\}f\(x)=\lim\_\{h\to 0\}\frac\{f(x+h)-f\(x)\}\{h\}$$
2019-12-20 17:12:46 +01:00
* Here’ s one that has a line break in it: _α _ + {_}ω{_} × {_}x{_}^2^.
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
These shouldn’ t be math:
2019-06-05 23:52:23 +02:00
* To get the famous equation, write {{$e = mc^2$}}.
2019-12-20 17:12:46 +01:00
* $22,000 is a _lot_ of money. So is $34,000. \(It worked if "lot" is emphasized.)
* Shoes \($20) and socks \($5).
2019-06-05 23:52:23 +02:00
* Escaped {{$}}: $73 _this should be emphasized_ 23$.
2019-11-22 16:57:24 +01:00
Here’ s a LaTeX table:
2019-06-05 23:52:23 +02:00
----
h1. {anchor:special-characters}Special Characters
Here is some unicode:
* I hat: Î
* o umlaut: ö
* section: §
* set membership: ∈
* copyright: ©
2019-11-22 16:57:24 +01:00
AT&T has an ampersand in their name.
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
AT&T is another way to write it.
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
This & that.
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
4 < 5.
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
6 > 5.
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
Backslash: \
2019-06-05 23:52:23 +02:00
Backtick: `
2019-11-22 16:57:24 +01:00
Asterisk: \*
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
Underscore: \_
2019-06-05 23:52:23 +02:00
Left brace: \{
2019-11-22 16:57:24 +01:00
Right brace: \}
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
Left bracket: \[
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
Right bracket: \]
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
Left paren: \(
2019-06-05 23:52:23 +02:00
Right paren: )
2019-12-20 17:12:46 +01:00
Greater-than: >
2019-06-05 23:52:23 +02:00
Hash: #
Period: .
2019-11-22 16:57:24 +01:00
Bang: \!
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
Plus: \+
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
Minus: \-
2019-06-05 23:52:23 +02:00
----
h1. {anchor:links}Links
h2. {anchor:explicit}Explicit
Just a [URL|/url/].
[URL and title|/url/].
[URL and title|/url/].
[URL and title|/url/].
[URL and title|/url/]
[URL and title|/url/]
2019-12-20 17:12:46 +01:00
[with_underscore|/url/with_underscore]
2019-06-05 23:52:23 +02:00
[Email link|mailto:nobody@nowhere.net]
[Empty|].
h2. {anchor:reference}Reference
Foo [bar|/url/].
2019-11-22 16:57:24 +01:00
With [embedded \[brackets\]|/url/].
2019-06-05 23:52:23 +02:00
[b|/url/] by itself should be a link.
Indented [once|/url].
Indented [twice|/url].
Indented [thrice|/url].
2019-11-22 16:57:24 +01:00
This should \[not\]\[\] be a link.
2019-06-05 23:52:23 +02:00
2021-03-08 12:40:25 +01:00
{noformat}
[not]: /url{noformat}
2019-06-05 23:52:23 +02:00
Foo [bar|/url/].
Foo [biz|/url/].
h2. {anchor:with-ampersands}With ampersands
2019-11-22 16:57:24 +01:00
Here’ s a [link with an ampersand in the URL|http://example.com/?foo=1&bar=2].
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
Here’ s a link with an amersand in the link text: [AT&T|http://att.com/].
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
Here’ s an [inline link|/script?foo=1&bar=2].
2019-06-05 23:52:23 +02:00
2019-11-22 16:57:24 +01:00
Here’ s an [inline link in pointy braces|/script?foo=1&bar=2].
2019-06-05 23:52:23 +02:00
h2. {anchor:autolinks}Autolinks
2020-04-04 15:03:13 +02:00
With an ampersand: [http://example.com/?foo=1&bar=2]
2019-06-05 23:52:23 +02:00
* In a list?
2020-04-04 15:03:13 +02:00
* [http://example.com/]
2019-06-05 23:52:23 +02:00
* It should.
2020-04-04 15:03:13 +02:00
An e-mail address: [mailto:nobody@nowhere.net]
2019-06-05 23:52:23 +02:00
2020-04-04 15:03:13 +02:00
bq. Blockquoted: [http://example.com/]
2019-12-20 17:12:46 +01:00
Auto-links should not occur here: {{<http://example.com/>}}
2019-06-05 23:52:23 +02:00
2021-03-08 12:40:25 +01:00
{noformat}
or here: <http://example.com/>{noformat}
2019-06-05 23:52:23 +02:00
----
h1. {anchor:images}Images
2019-12-20 17:12:46 +01:00
From "Voyage dans la Lune" by Georges Melies \(1902):
2019-06-05 23:52:23 +02:00
2020-07-17 16:01:41 +02:00
!lalune.jpg|title=fig:Voyage dans la Lune, alt=lalune!
2019-06-05 23:52:23 +02:00
2020-07-17 16:01:41 +02:00
Here is a movie !movie.jpg|alt=movie! icon.
2019-06-05 23:52:23 +02:00
----
h1. {anchor:footnotes}Footnotes
2019-11-22 16:57:24 +01:00
Here 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]
2019-06-05 23:52:23 +02:00
bq. Notes can go in quotes.[4]
# And in list items.[5]
This paragraph should not be part of the note, as it is not indented.
2019-12-20 17:12:46 +01:00
\[1] Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
\[2] Here’ s the long note. This one contains multiple blocks.
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
Subsequent blocks are indented to show that they belong to the footnote \(as with list items).
2019-06-05 23:52:23 +02:00
2021-03-08 12:40:25 +01:00
{noformat}
{ <code> }{noformat}
2019-06-05 23:52:23 +02:00
If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
2019-12-20 17:12:46 +01:00
\[3] This is _easier_ to type. Inline notes may contain [links|http://google.com] and {{\]}} verbatim characters, as well as \[bracketed text].
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
\[4] In quote.
2019-06-05 23:52:23 +02:00
2019-12-20 17:12:46 +01:00
\[5] In list.