--- title: Extensions test author: Yuki Izumi version: 0.1 date: '2016-08-31' license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)' ... ## Tables Here's a well-formed table, doing everything it should. ```````````````````````````````` example | abc | def | | --- | --- | | ghi | jkl | | mno | pqr | .
abc def
ghi jkl
mno pqr
```````````````````````````````` We're going to mix up the table now; we'll demonstrate that inline formatting works fine, but block elements don't. You can also have empty cells, and the textual alignment of the columns is shown to be irrelevant. ```````````````````````````````` example Hello! | _abc_ | セン | | ----- | ---- | | 1. Block elements inside cells don't work. | | | But _**inline elements do**_. | x | Hi! .

Hello!

abc セン
1. Block elements inside cells don't work.
But inline elements do. x

Hi!

```````````````````````````````` Here we demonstrate some edge cases about what is and isn't a table. ```````````````````````````````` example | Not enough table | to be considered table | | Not enough table | to be considered table | | Not enough table | to be considered table | | Just enough table | to be considered table | | ----------------- | ---------------------- | | ---- | --- | |x| |-| | xyz | | --- | .

| Not enough table | to be considered table |

| Not enough table | to be considered table | | Not enough table | to be considered table |

Just enough table to be considered table

| ---- | --- |

x
xyz
```````````````````````````````` A "simpler" table, GFM style: ```````````````````````````````` example abc | def --- | --- xyz | ghi .
abc def
xyz ghi
```````````````````````````````` We are making the parser slighly more lax here. Here is a table with spaces at the end: ```````````````````````````````` example Hello! | _abc_ | セン | | ----- | ---- | | this row has a space at the end | | | But _**inline elements do**_. | x | Hi! .

Hello!

abc セン
this row has a space at the end
But inline elements do. x

Hi!

```````````````````````````````` Table alignment: ```````````````````````````````` example aaa | bbb | ccc | ddd | eee :-- | --- | :-: | --- | --: fff | ggg | hhh | iii | jjj .
aaa bbb ccc ddd eee
fff ggg hhh iii jjj
```````````````````````````````` ### Table cell count mismatches The header and marker row must match. ```````````````````````````````` example | a | b | c | | --- | --- | | this | isn't | okay | .

| a | b | c | | --- | --- | | this | isn't | okay |

```````````````````````````````` But any of the body rows can be shorter. Rows longer than the header are truncated. ```````````````````````````````` example | a | b | c | | --- | --- | --- | x | a | b | 1 | 2 | 3 | 4 | 5 | .
a b c
x
a b
1 2 3
```````````````````````````````` ### Embedded pipes Tables with embedded pipes could be tricky. ```````````````````````````````` example | a | b | | --- | --- | | Escaped pipes are \|okay\|. | Like \| this. | | Within `\|code\| is okay` too. | | _**`c\|`**_ \| complex | don't **\_reparse\_** .
a b
Escaped pipes are |okay|. Like | this.
Within |code| is okay too.
c| | complex
don't _reparse_
```````````````````````````````` ### Oddly-formatted markers This shouldn't assert. ```````````````````````````````` example | a | --- | .
a
```````````````````````````````` ### Escaping ```````````````````````````````` example | a | b | | --- | --- | | \\ | `\\` | | \\\\ | `\\\\` | | \_ | `\_` | | \| | `\|` | | \a | `\a` | \\ `\\` \\\\ `\\\\` \_ `\_` \| `\|` \a `\a` .
a b
\ \\
\\ \\\\
_ \_
| |
\a \a

\ \\

\\ \\\\

_ \_

| \|

\a \a

```````````````````````````````` ### Embedded HTML ```````````````````````````````` example | a | | --- | | hello | | ok
sure | .
a
hello
ok
sure
```````````````````````````````` ### Reference-style links ```````````````````````````````` example Here's a link to [Freedom Planet 2][]. | Here's a link to [Freedom Planet 2][] in a table header. | | --- | | Here's a link to [Freedom Planet 2][] in a table row. | [Freedom Planet 2]: http://www.freedomplanet2.com/ .

Here's a link to Freedom Planet 2.

Here's a link to Freedom Planet 2 in a table header.
Here's a link to Freedom Planet 2 in a table row.
```````````````````````````````` ### Sequential cells ```````````````````````````````` example | a | b | c | | --- | --- | --- | | d || e | .
a b c
d e
```````````````````````````````` ### Interaction with emphasis ```````````````````````````````` example | a | b | | --- | --- | |***(a)***| .
a b
(a)
```````````````````````````````` ## Strikethroughs A well-formed strikethrough. ```````````````````````````````` example A proper ~strikethrough~. .

A proper strikethrough.

```````````````````````````````` Some strikethrough edge cases. ```````````````````````````````` example These are ~not strikethroughs. No, they are not~ This ~is ~ legit~ isn't ~ legit. This is not ~~~~~one~~~~~ huge strikethrough. ~one~ ~~two~~ ~~~three~~~ No ~mismatch~~ .

These are ~not strikethroughs.

No, they are not~

This is ~ legit isn't ~ legit.

This is not ~~~~~one~~~~~ huge strikethrough.

one two ~~~three~~~

No ~mismatch~~

```````````````````````````````` Using 200 tilde since it overflows the internal buffer size (100) for parsing delimiters in inlines.c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~striked~ ## Autolinks ```````````````````````````````` example : http://google.com https://google.com http://google.com/å scyther@pokemon.com www.github.com www.github.com/á www.google.com/a_b **Autolink and http://inlines** ![http://inline.com/image](http://inline.com/image) a.w@b.c Full stop outside parens shouldn't be included http://google.com/ok. (Full stop inside parens shouldn't be included http://google.com/ok.) "http://google.com" 'http://google.com' http://🍄.ga/ http://x🍄.ga/ .

: http://google.com https://google.com

http://google.com/å http://google.com/å

scyther@pokemon.com

www.github.com www.github.com/á

www.google.com/a_b

Autolink and http://inlines

http://inline.com/image

a.w@b.c

Full stop outside parens shouldn't be included http://google.com/ok.

(Full stop inside parens shouldn't be included http://google.com/ok.)

"http://google.com"

'http://google.com'

http://🍄.ga/ http://x🍄.ga/

```````````````````````````````` ```````````````````````````````` example This shouldn't crash everything: (_A_@_.A . ```````````````````````````````` ```````````````````````````````` example These should not link: * @a.b.c@. x * n@. b .

These should not link:

```````````````````````````````` ## HTML tag filter ```````````````````````````````` example This is not okay, but **this** <strong>is</strong>. <p>This is <xmp> not okay, but **this** <strong>is</strong>.</p> Nope, I won't have <textarea>. <p>No <textarea> here either.</p> <p>This <random /> <thing> is okay</thing> though.</p> Yep, <totally>okay</totally>. <!-- HTML comments are okay, though. --> <!- But we're strict. -> <! No nonsense. > <!-- Leave multiline comments the heck alone, though, okay? Even with {"x":"y"} or 1 > 2 or whatever. Even **markdown**. --> <!--- Support everything CommonMark's parser does. --> <!----> <!--thistoo--> . <p>This is &lt;xmp> not okay, but <strong>this</strong> <strong>is</strong>.</p> <p>This is &lt;xmp> not okay, but **this** <strong>is</strong>.</p> <p>Nope, I won't have &lt;textarea>.</p> <p>No &lt;textarea> here either.</p> <p>This <random /> <thing> is okay</thing> though.</p> <p>Yep, <totally>okay</totally>.</p> <!-- HTML comments are okay, though. --> <p>&lt;!- But we're strict. -&gt; &lt;! No nonsense. &gt;</p> <!-- Leave multiline comments the heck alone, though, okay? Even with {"x":"y"} or 1 > 2 or whatever. Even **markdown**. --> <!--- Support everything CommonMark's parser does. --> <!----> <!--thistoo--> ```````````````````````````````` ## Footnotes ```````````````````````````````` example This is some text![^1]. Other text.[^footnote]. Here's a thing[^other-note]. And another thing[^codeblock-note]. This doesn't have a referent[^nope]. [^other-note]: no code block here (spaces are stripped away) [^codeblock-note]: this is now a code block (8 spaces indentation) [^1]: Some *bolded* footnote definition. Hi! [^footnote]: > Blockquotes can be in a footnote. as well as code blocks or, naturally, simple paragraphs. [^unused]: This is unused. . <p>This is some text!<sup class="footnote-ref"><a href="#fn1" id="fnref1">1</a></sup>. Other text.<sup class="footnote-ref"><a href="#fn2" id="fnref2">2</a></sup>.</p> <p>Here's a thing<sup class="footnote-ref"><a href="#fn3" id="fnref3">3</a></sup>.</p> <p>And another thing<sup class="footnote-ref"><a href="#fn4" id="fnref4">4</a></sup>.</p> <p>This doesn't have a referent[^nope].</p> <p>Hi!</p> <section class="footnotes"> <ol> <li id="fn1"> <p>Some <em>bolded</em> footnote definition. <a href="#fnref1" class="footnote-backref">↩</a></p> </li> <li id="fn2"> <blockquote> <p>Blockquotes can be in a footnote.</p> </blockquote> <pre><code>as well as code blocks </code></pre> <p>or, naturally, simple paragraphs. <a href="#fnref2" class="footnote-backref">↩</a></p> </li> <li id="fn3"> <p>no code block here (spaces are stripped away) <a href="#fnref3" class="footnote-backref">↩</a></p> </li> <li id="fn4"> <pre><code>this is now a code block (8 spaces indentation) </code></pre> <a href="#fnref4" class="footnote-backref">↩</a> </li> </ol> </section> ```````````````````````````````` ## Interop Autolink and strikethrough. ```````````````````````````````` example ~~www.google.com~~ ~~http://google.com~~ . <p><del><a href="http://www.google.com">www.google.com</a></del></p> <p><del><a href="http://google.com">http://google.com</a></del></p> ```````````````````````````````` Autolink and tables. ```````````````````````````````` example | a | b | | --- | --- | | https://github.com www.github.com | http://pokemon.com | . <table> <thead> <tr> <th>a</th> <th>b</th> </tr> </thead> <tbody> <tr> <td><a href="https://github.com">https://github.com</a> <a href="http://www.github.com">www.github.com</a></td> <td><a href="http://pokemon.com">http://pokemon.com</a></td> </tr> </tbody> </table> ```````````````````````````````` ## Task lists ```````````````````````````````` example - [ ] foo - [x] bar . <ul> <li><input type="checkbox" disabled="" /> foo</li> <li><input type="checkbox" checked="" disabled="" /> bar</li> </ul> ```````````````````````````````` ```````````````````````````````` example - [x] foo - [ ] bar - [x] baz - [ ] bim . <ul> <li><input type="checkbox" checked="" disabled="" /> foo <ul> <li><input type="checkbox" disabled="" /> bar</li> <li><input type="checkbox" checked="" disabled="" /> baz</li> </ul> </li> <li><input type="checkbox" disabled="" /> bim</li> </ul> ````````````````````````````````