mirror of
https://github.com/jgm/pandoc.git
synced 2026-07-09 19:07:23 +00:00
8547196b44
(or equivalent, e.g. 'i'). This brings the markdown parser in line with commonmark, and avoids a lot of unintended list starts. Closes #11735. Note that ordered lists that are not sublists may still start with numbers other than 1.
730 lines
9.4 KiB
Plaintext
730 lines
9.4 KiB
Plaintext
This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.
|
||
|
||
* * *
|
||
|
||
[u][b]Headers[/b][/u]
|
||
|
||
[b]Level 2 with an [url=/url]embedded link[/url][/b]
|
||
|
||
[u]Level 3 with [i]emphasis[/i][/u]
|
||
|
||
Level 4
|
||
|
||
Level 5
|
||
|
||
[u][b]Level 1[/b][/u]
|
||
|
||
[b]Level 2 with [i]emphasis[/i][/b]
|
||
|
||
[u]Level 3[/u]
|
||
|
||
with no blank line
|
||
|
||
[b]Level 2[/b]
|
||
|
||
with no blank line
|
||
|
||
* * *
|
||
|
||
[u][b]Paragraphs[/b][/u]
|
||
|
||
Here's a regular paragraph.
|
||
|
||
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.
|
||
|
||
Here's one with a bullet. * criminey.
|
||
|
||
There should be a hard line break
|
||
here.
|
||
|
||
* * *
|
||
|
||
[u][b]Block Quotes[/b][/u]
|
||
|
||
E-mail style:
|
||
|
||
[quote]
|
||
This is a block quote. It is pretty short.
|
||
[/quote]
|
||
|
||
[quote]
|
||
Code in a block quote:
|
||
|
||
[code]sub status {
|
||
print "working";
|
||
}
|
||
[/code]
|
||
|
||
A list:
|
||
|
||
[list=1]
|
||
[*]item one
|
||
[*]item two
|
||
[/list]
|
||
|
||
Nested block quotes:
|
||
|
||
[quote]
|
||
nested
|
||
[/quote]
|
||
|
||
[quote]
|
||
nested
|
||
[/quote]
|
||
[/quote]
|
||
|
||
This should not be a block quote: 2 > 1.
|
||
|
||
And a following paragraph.
|
||
|
||
* * *
|
||
|
||
[u][b]Code Blocks[/b][/u]
|
||
|
||
Code:
|
||
|
||
[code]---- (should be four hyphens)
|
||
|
||
sub status {
|
||
print "working";
|
||
}
|
||
|
||
this code block is indented by one tab
|
||
[/code]
|
||
|
||
And:
|
||
|
||
[code] this code block is indented by two tabs
|
||
|
||
These should not be escaped: \$ \\ \> \[ \{
|
||
[/code]
|
||
|
||
* * *
|
||
|
||
[u][b]Lists[/b][/u]
|
||
|
||
[b]Unordered[/b]
|
||
|
||
Asterisks tight:
|
||
|
||
[list]
|
||
[*]asterisk 1
|
||
[*]asterisk 2
|
||
[*]asterisk 3
|
||
[/list]
|
||
|
||
Asterisks loose:
|
||
|
||
[list]
|
||
[*]asterisk 1
|
||
[*]asterisk 2
|
||
[*]asterisk 3
|
||
[/list]
|
||
|
||
Pluses tight:
|
||
|
||
[list]
|
||
[*]Plus 1
|
||
[*]Plus 2
|
||
[*]Plus 3
|
||
[/list]
|
||
|
||
Pluses loose:
|
||
|
||
[list]
|
||
[*]Plus 1
|
||
[*]Plus 2
|
||
[*]Plus 3
|
||
[/list]
|
||
|
||
Minuses tight:
|
||
|
||
[list]
|
||
[*]Minus 1
|
||
[*]Minus 2
|
||
[*]Minus 3
|
||
[/list]
|
||
|
||
Minuses loose:
|
||
|
||
[list]
|
||
[*]Minus 1
|
||
[*]Minus 2
|
||
[*]Minus 3
|
||
[/list]
|
||
|
||
[b]Ordered[/b]
|
||
|
||
Tight:
|
||
|
||
[list=1]
|
||
[*]First
|
||
[*]Second
|
||
[*]Third
|
||
[/list]
|
||
|
||
and:
|
||
|
||
[list=1]
|
||
[*]One
|
||
[*]Two
|
||
[*]Three
|
||
[/list]
|
||
|
||
Loose using tabs:
|
||
|
||
[list=1]
|
||
[*]First
|
||
[*]Second
|
||
[*]Third
|
||
[/list]
|
||
|
||
and using spaces:
|
||
|
||
[list=1]
|
||
[*]One
|
||
[*]Two
|
||
[*]Three
|
||
[/list]
|
||
|
||
Multiple paragraphs:
|
||
|
||
[list=1]
|
||
[*]Item 1, graf one.
|
||
|
||
Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
|
||
[*]Item 2.
|
||
[*]Item 3.
|
||
[/list]
|
||
|
||
[b]Nested[/b]
|
||
|
||
[list]
|
||
[*]Tab
|
||
|
||
[list]
|
||
[*]Tab
|
||
|
||
[list]
|
||
[*]Tab
|
||
[/list]
|
||
[/list]
|
||
[/list]
|
||
|
||
Here's another:
|
||
|
||
[list=1]
|
||
[*]First
|
||
[*]Second:
|
||
|
||
[list]
|
||
[*]Fee
|
||
[*]Fie
|
||
[*]Foe
|
||
[/list]
|
||
[*]Third
|
||
[/list]
|
||
|
||
Same thing but with paragraphs:
|
||
|
||
[list=1]
|
||
[*]First
|
||
[*]Second:
|
||
|
||
[list]
|
||
[*]Fee
|
||
[*]Fie
|
||
[*]Foe
|
||
[/list]
|
||
[*]Third
|
||
[/list]
|
||
|
||
[b]Tabs and spaces[/b]
|
||
|
||
[list]
|
||
[*]this is a list item indented with tabs
|
||
[*]this is a list item indented with spaces
|
||
|
||
[list]
|
||
[*]this is an example list item indented with tabs
|
||
[*]this is an example list item indented with spaces
|
||
[/list]
|
||
[/list]
|
||
|
||
[b]Fancy list markers[/b]
|
||
|
||
[list=1]
|
||
[*]begins with 2
|
||
[*]and now 3
|
||
|
||
with a continuation
|
||
|
||
[list=i]
|
||
[*]sublist with roman numerals starting with i.
|
||
[*]more items
|
||
|
||
[list=A]
|
||
[*]a subsublist
|
||
[*]a subsublist
|
||
[/list]
|
||
[/list]
|
||
[/list]
|
||
|
||
Nesting:
|
||
|
||
[list=A]
|
||
[*]Upper Alpha
|
||
|
||
[list=I]
|
||
[*]Upper Roman.
|
||
|
||
[list=1]
|
||
[*]Decimal start with 1
|
||
|
||
[list=a]
|
||
[*]Lower alpha with paren
|
||
[/list]
|
||
[/list]
|
||
[/list]
|
||
[/list]
|
||
|
||
Autonumbering:
|
||
|
||
[list=1]
|
||
[*]Autonumber.
|
||
[*]More.
|
||
|
||
[list=1]
|
||
[*]Nested.
|
||
[/list]
|
||
[/list]
|
||
|
||
Should not be a list item:
|
||
|
||
M.A. 2007
|
||
|
||
B. Williams
|
||
|
||
* * *
|
||
|
||
[u][b]Definition Lists[/b][/u]
|
||
|
||
Tight using spaces:
|
||
|
||
apple
|
||
[list]
|
||
[*]red fruit
|
||
[/list]
|
||
orange
|
||
[list]
|
||
[*]orange fruit
|
||
[/list]
|
||
banana
|
||
[list]
|
||
[*]yellow fruit
|
||
[/list]
|
||
|
||
Tight using tabs:
|
||
|
||
apple
|
||
[list]
|
||
[*]red fruit
|
||
[/list]
|
||
orange
|
||
[list]
|
||
[*]orange fruit
|
||
[/list]
|
||
banana
|
||
[list]
|
||
[*]yellow fruit
|
||
[/list]
|
||
|
||
Loose:
|
||
|
||
apple
|
||
[list]
|
||
[*]red fruit
|
||
[/list]
|
||
orange
|
||
[list]
|
||
[*]orange fruit
|
||
[/list]
|
||
banana
|
||
[list]
|
||
[*]yellow fruit
|
||
[/list]
|
||
|
||
Multiple blocks with italics:
|
||
|
||
[i]apple[/i]
|
||
[list]
|
||
[*]red fruit
|
||
|
||
contains seeds, crisp, pleasant to taste
|
||
[/list]
|
||
[i]orange[/i]
|
||
[list]
|
||
[*]orange fruit
|
||
|
||
[code]{ orange code block }
|
||
[/code]
|
||
|
||
[quote]
|
||
orange block quote
|
||
[/quote]
|
||
[/list]
|
||
|
||
Multiple definitions, tight:
|
||
|
||
apple
|
||
[list]
|
||
[*]red fruit
|
||
[*]computer
|
||
[/list]
|
||
orange
|
||
[list]
|
||
[*]orange fruit
|
||
[*]bank
|
||
[/list]
|
||
|
||
Multiple definitions, loose:
|
||
|
||
apple
|
||
[list]
|
||
[*]red fruit
|
||
[*]computer
|
||
[/list]
|
||
orange
|
||
[list]
|
||
[*]orange fruit
|
||
[*]bank
|
||
[/list]
|
||
|
||
Blank line after term, indented marker, alternate markers:
|
||
|
||
apple
|
||
[list]
|
||
[*]red fruit
|
||
[*]computer
|
||
[/list]
|
||
orange
|
||
[list]
|
||
[*]orange fruit
|
||
|
||
[list=1]
|
||
[*]sublist
|
||
[*]sublist
|
||
[/list]
|
||
[/list]
|
||
|
||
[u][b]HTML Blocks[/b][/u]
|
||
|
||
Simple block on one line:
|
||
|
||
foo
|
||
|
||
And nested without indentation:
|
||
|
||
foo
|
||
|
||
bar
|
||
|
||
Interpreted markdown in a table:
|
||
|
||
This is [i]emphasized[/i]
|
||
|
||
And this is [b]strong[/b]
|
||
|
||
Here's a simple block:
|
||
|
||
foo
|
||
|
||
This should be a code block, though:
|
||
|
||
[code]<div>
|
||
foo
|
||
</div>
|
||
[/code]
|
||
|
||
As should this:
|
||
|
||
[code]<div>foo</div>
|
||
[/code]
|
||
|
||
Now, nested:
|
||
|
||
foo
|
||
|
||
This should just be an HTML comment:
|
||
|
||
Multiline:
|
||
|
||
Code block:
|
||
|
||
[code]<!-- Comment -->
|
||
[/code]
|
||
|
||
Just plain comment, with trailing spaces on the line:
|
||
|
||
Code:
|
||
|
||
[code]<hr />
|
||
[/code]
|
||
|
||
Hr's:
|
||
|
||
* * *
|
||
|
||
[u][b]Inline Markup[/b][/u]
|
||
|
||
This is [i]emphasized[/i], and so [i]is this[/i].
|
||
|
||
This is [b]strong[/b], and so [b]is this[/b].
|
||
|
||
An [i][url=/url]emphasized link[/url][/i].
|
||
|
||
[b][i]This is strong and em.[/i][/b]
|
||
|
||
So is [b][i]this[/i][/b] word.
|
||
|
||
[b][i]This is strong and em.[/i][/b]
|
||
|
||
So is [b][i]this[/i][/b] word.
|
||
|
||
This is code: >, $, \, \$, <html>.
|
||
|
||
[s]This is [i]strikeout[/i].[/s]
|
||
|
||
Superscripts: abcd a[i]hello[/i] ahello there.
|
||
|
||
Subscripts: H2O, H23O, Hmany of themO.
|
||
|
||
These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
|
||
|
||
* * *
|
||
|
||
[u][b]Smart quotes, ellipses, dashes[/b][/u]
|
||
|
||
"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.'
|
||
|
||
'He said, "I want to go."' Were you alive in the 70's?
|
||
|
||
Here is some quoted 'code' and a "[url=http://example.com/?foo=1&bar=2]quoted link[/url]".
|
||
|
||
Some dashes: one---two --- three---four --- five.
|
||
|
||
Dashes between numbers: 5--7, 255--66, 1987--1999.
|
||
|
||
Ellipses...and...and....
|
||
|
||
* * *
|
||
|
||
[u][b]LaTeX[/b][/u]
|
||
|
||
[list]
|
||
[*]
|
||
[*]$2+2=4$
|
||
[*]$x \in y$
|
||
[*]$\alpha \wedge \omega$
|
||
[*]$223$
|
||
[*]$p$-Tree
|
||
[*]Here's some display math: [code=latex]$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
|
||
[/code]
|
||
[*]Here's one that has a line break in it: $\alpha + \omega \times x^2$.
|
||
[/list]
|
||
|
||
These shouldn't be math:
|
||
|
||
[list]
|
||
[*]To get the famous equation, write $e = mc^2$.
|
||
[*]$22,000 is a [i]lot[/i] of money. So is $34,000. (It worked if "lot" is emphasized.)
|
||
[*]Shoes ($20) and socks ($5).
|
||
[*]Escaped $: $73 [i]this should be emphasized[/i] 23$.
|
||
[/list]
|
||
|
||
Here's a LaTeX table:
|
||
|
||
* * *
|
||
|
||
[u][b]Special Characters[/b][/u]
|
||
|
||
Here is some unicode:
|
||
|
||
[list]
|
||
[*]I hat: Î
|
||
[*]o umlaut: ö
|
||
[*]section: §
|
||
[*]set membership: ∈
|
||
[*]copyright: ©
|
||
[/list]
|
||
|
||
AT&T has an ampersand in their name.
|
||
|
||
AT&T is another way to write it.
|
||
|
||
This & that.
|
||
|
||
4 < 5.
|
||
|
||
6 > 5.
|
||
|
||
Backslash: \
|
||
|
||
Backtick: `
|
||
|
||
Asterisk: *
|
||
|
||
Underscore: _
|
||
|
||
Left brace: {
|
||
|
||
Right brace: }
|
||
|
||
Left bracket: [
|
||
|
||
Right bracket: ]
|
||
|
||
Left paren: (
|
||
|
||
Right paren: )
|
||
|
||
Greater-than: >
|
||
|
||
Hash: #
|
||
|
||
Period: .
|
||
|
||
Bang: !
|
||
|
||
Plus: +
|
||
|
||
Minus: -
|
||
|
||
* * *
|
||
|
||
[u][b]Links[/b][/u]
|
||
|
||
[b]Explicit[/b]
|
||
|
||
Just a [url=/url/]URL[/url].
|
||
|
||
[url=/url/]URL and title[/url].
|
||
|
||
[url=/url/]URL and title[/url].
|
||
|
||
[url=/url/]URL and title[/url].
|
||
|
||
[url=/url/]URL and title[/url]
|
||
|
||
[url=/url/]URL and title[/url]
|
||
|
||
[url=/url/with_underscore]with_underscore[/url]
|
||
|
||
[email=nobody@nowhere.net]Email link[/email]
|
||
|
||
[url]Empty[/url].
|
||
|
||
[b]Reference[/b]
|
||
|
||
Foo [url=/url/]bar[/url].
|
||
|
||
With [url=/url/]embedded [brackets][/url].
|
||
|
||
[url=/url/]b[/url] by itself should be a link.
|
||
|
||
Indented [url=/url]once[/url].
|
||
|
||
Indented [url=/url]twice[/url].
|
||
|
||
Indented [url=/url]thrice[/url].
|
||
|
||
This should [not][] be a link.
|
||
|
||
[code][not]: /url
|
||
[/code]
|
||
|
||
Foo [url=/url/]bar[/url].
|
||
|
||
Foo [url=/url/]biz[/url].
|
||
|
||
[b]With ampersands[/b]
|
||
|
||
Here's a [url=http://example.com/?foo=1&bar=2]link with an ampersand in the URL[/url].
|
||
|
||
Here's a link with an amersand in the link text: [url=http://att.com/]AT&T[/url].
|
||
|
||
Here's an [url=/script?foo=1&bar=2]inline link[/url].
|
||
|
||
Here's an [url=/script?foo=1&bar=2]inline link in pointy braces[/url].
|
||
|
||
[b]Autolinks[/b]
|
||
|
||
With an ampersand: [url]http://example.com/?foo=1&bar=2[/url]
|
||
|
||
[list]
|
||
[*]In a list?
|
||
[*][url]http://example.com/[/url]
|
||
[*]It should.
|
||
[/list]
|
||
|
||
An e-mail address: [email]nobody@nowhere.net[/email]
|
||
|
||
[quote]
|
||
Blockquoted: [url]http://example.com/[/url]
|
||
[/quote]
|
||
|
||
Auto-links should not occur here: <http://example.com/>
|
||
|
||
[code]or here: <http://example.com/>
|
||
[/code]
|
||
|
||
* * *
|
||
|
||
[u][b]Images[/b][/u]
|
||
|
||
From "Voyage dans la Lune" by Georges Melies (1902):
|
||
|
||
[img alt="lalune" title="Voyage dans la Lune"]lalune.jpg[/img]
|
||
lalune
|
||
|
||
Here is a movie [img alt="movie"]movie.jpg[/img] icon.
|
||
|
||
* * *
|
||
|
||
[u][b]Footnotes[/b][/u]
|
||
|
||
Here is a footnote reference,(1) and another.(2) This should [i]not[/i] be a footnote reference, because it contains a space.[^my note] Here is an inline note.(3)
|
||
|
||
[quote]
|
||
Notes can go in quotes.(4)
|
||
[/quote]
|
||
|
||
[list=1]
|
||
[*]And in list items.(5)
|
||
[/list]
|
||
|
||
This paragraph should not be part of the note, as it is not indented.
|
||
|
||
* * *
|
||
|
||
(1) Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
|
||
|
||
(2) Here's the long note. This one contains multiple blocks.
|
||
|
||
Subsequent blocks are indented to show that they belong to the footnote (as with list items).
|
||
|
||
[code] { <code> }
|
||
[/code]
|
||
|
||
If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
|
||
|
||
(3) This is [i]easier[/i] to type. Inline notes may contain [url=http://google.com]links[/url] and ] verbatim characters, as well as [bracketed text].
|
||
|
||
(4) In quote.
|
||
|
||
(5) In list.
|