</dl>
!! end
+!! test
+Definition and unordered list using wiki syntax nested in unordered list using html tags.
+!! input
+<ul><li>
+; term : description
+* unordered
+</li>
+</ul>
+!! result
+<ul><li>
+<dl><dt> term </dt><dd> description
+</dd></dl>
+<ul><li> unordered
+</li></ul>
+</li>
+</ul>
+
+!! end
+
+
###
### External links
###
</p>
!!end
+!! test
+External links: protocol-relative URL in brackets
+!! input
+[//example.com/ Test]
+!! result
+<p><a rel="nofollow" class="external text" href="//example.com/">Test</a>
+</p>
+!! end
+
+!! test
+External links: protocol-relative URL in brackets without text
+!! input
+[//example.com]
+!! result
+<p><a rel="nofollow" class="external autonumber" href="//example.com">[1]</a>
+</p>
+!! end
+
+!! test
+External links: protocol-relative URL in free text is left alone
+!! input
+//example.com/Foo
+!! result
+<p>//example.com/Foo
+</p>
+!!end
+
+!! test
+External links: protocol-relative URL in the middle of a word is left alone (bug 30269)
+!! input
+foo//example.com/Foo
+!! result
+<p>foo//example.com/Foo
+</p>
+!! end
+
!! test
External image
!! input
</p>
!! end
-!! test
-External links: links containing empty bracket pair []
-!! input
-[http://example.com?parameter[]=foo link]
-!! result
-<p><a rel="nofollow" class="external text" href="http://example.com?parameter%5B%5D=foo">link</a>
-</p>
-!! end
-
-!! test
-External links: links ending in empty bracket pair []
-!! input
-[http://example.com?parameter[]=foo&option[]]
-!! result
-<p><a rel="nofollow" class="external autonumber" href="http://example.com?parameter%5B%5D=foo&option%5B%5D">[1]</a>
-</p>
-!! end
-
-!! test
-External links: bare links ending in empty bracket pair []
-!! input
-http://example.com?parameter[]=foo&option[]
-!! result
-<p><a rel="nofollow" class="external free" href="http://example.com?parameter%5B%5D=foo&option%5B%5D">http://example.com?parameter%5B%5D=foo&option%5B%5D</a>
-</p>
-!! end
-
!! test
BUG 787: Links with one slash after the url protocol are invalid
!! input
</p>
!! end
+# According to http://dev.w3.org/html5/spec/Overview.html#parsing-urls a plain
+# % is actually legal in HTML5. Any change in output would need testing though.
!! test
-Bug 4781, 5267: %26 in URL
+Bug 4781, 5267: %25 in URL
!! input
http://www.example.com/?title=100%25_Bran
!! result
</p>
!! end
+!! test
+Brackets in urls
+!! input
+http://example.com/index.php?foozoid%5B%5D=bar
+
+http://example.com/index.php?foozoid[]=bar
+!! result
+<p><a rel="nofollow" class="external free" href="http://example.com/index.php?foozoid%5B%5D=bar">http://example.com/index.php?foozoid%5B%5D=bar</a>
+</p><p><a rel="nofollow" class="external free" href="http://example.com/index.php?foozoid%5B%5D=bar">http://example.com/index.php?foozoid%5B%5D=bar</a>
+</p>
+!! end
+
+!! test
+IPv6 urls (bug 21261)
+!! options
+disabled
+!! input
+http://[2404:130:0:1000::187:2]/index.php
+!! result
+<p><a rel="nofollow" class="external free" href="http://[2404:130:0:1000::187:2]/index.php">http://[2404:130:0:1000::187:2]/index.php</a>
+</p>
+!! end
+
###
### Quotes
###
|}
!! result
<table>
-<caption>caption
-</caption>
-<tr><td></td></tr>
-</table>
+<caption> caption
+</caption><tr><td></td></tr></table>
!! end
!! result
<table>
<tr>
-<td>1</td>
-<td>2</td>
-</tr>
+<td> 1 </td>
+<td> 2
+</td></tr>
<tr>
-<td>3</td>
-<td>4</td>
-</tr>
-</table>
+<td> 3 </td>
+<td> 4
+</td></tr></table>
!! end
<table border="1" cellpadding="2">
<caption>Multiplication table
</caption>
-<thead>
<tr>
-<th>×</th>
-<th>1</th>
-<th>2</th>
-<th>3</th>
-</tr></thead>
-<tbody>
+<th> × </th>
+<th> 1 </th>
+<th> 2 </th>
+<th> 3
+</th></tr>
<tr>
-<th>1</th>
-<td>1</td>
-<td>2</td>
-<td>3</td>
-</tr>
+<th> 1
+</th>
+<td> 1 </td>
+<td> 2 </td>
+<td> 3
+</td></tr>
<tr>
-<th>2</th>
-<td>2</td>
-<td>4</td>
-<td>6</td>
-</tr>
+<th> 2
+</th>
+<td> 2 </td>
+<td> 4 </td>
+<td> 6
+</td></tr>
<tr>
-<th>3</th>
-<td>3</td>
-<td>6</td>
-<td>9</td>
-</tr>
+<th> 3
+</th>
+<td> 3 </td>
+<td> 6 </td>
+<td> 9
+</td></tr>
<tr>
-<th>4</th>
-<td>4</td>
-<td>8</td>
-<td>12</td>
-</tr>
+<th> 4
+</th>
+<td> 4 </td>
+<td> 8 </td>
+<td> 12
+</td></tr>
<tr>
-<th>5</th>
-<td>5</td>
-<td>10</td>
-<td>15</td>
-</tr></tbody>
-</table>
+<th> 5
+</th>
+<td> 5 </td>
+<td> 10 </td>
+<td> 15
+</td></tr></table>
!! end
!! test
Table rowspan
!! input
-{| align=right border=1
+{| border=1
| Cell 1, row 1
|rowspan=2| Cell 2, row 1 (and 2)
| Cell 3, row 1
| Cell 3, row 2
|}
!! result
-<table align="right" border="1">
+<table border="1">
<tr>
-<td>Cell 1, row 1</td>
-<td rowspan="2">Cell 2, row 1 (and 2)</td>
-<td>Cell 3, row 1</td>
-</tr>
+<td> Cell 1, row 1
+</td>
+<td rowspan="2"> Cell 2, row 1 (and 2)
+</td>
+<td> Cell 3, row 1
+</td></tr>
<tr>
-<td>Cell 1, row 2</td>
-<td>Cell 3, row 2</td>
-</tr>
-</table>
+<td> Cell 1, row 2
+</td>
+<td> Cell 3, row 2
+</td></tr></table>
!! end
!! result
<table border="1">
<tr>
-<td>α</td>
+<td> α
+</td>
<td>
<table bgcolor="#ABCDEF" border="2">
<tr>
-<td>nested</td>
-</tr>
+<td>nested
+</td></tr>
<tr>
-<td>table</td>
-</tr>
-</table></td>
-<td>the original table again</td>
-</tr>
-</table>
+<td>table
+</td></tr></table>
+</td>
+<td>the original table again
+</td></tr></table>
!! end
!! result
<table>
<tr>
-<td>broken</td>
-</tr>
-</table>
-
-!! end
-
-!! test
-Heading inside table (affected by r85922)
-!! input
-{|
-|- valign="top"
-|
-=== Heading ===
-|}
-!! result
-<table>
-<tr valign="top">
-<td>
-<h3><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Heading">edit</a>]</span> <span class="mw-headline" id="Heading"> Heading </span></h3>
-</td>
-</tr>
-</table>
-
-!! end
-
-!! test
-A table with a caption with unclosed italic
-!! input
-{|
-|+ ''caption
-| Cell
-|}
-!! result
-<table>
-<caption><i>caption</i>
-</caption>
-<tr>
-<td>Cell</td>
-</tr>
-</table>
-
-!! end
-
-!! test
-A table with unclosed italic in a cell
-!! input
-{|
-| ''Cell
-|}
-!! result
-<table>
-<tr>
-<td><i>Cell</i></td>
-</tr>
-</table>
+<td>broken
+</td></tr></table>
!! end
-!! test
-A table with unclosed italic in a th
-!! input
-{|
-|-
-! ''Cell
-|| Value
-|}
-!! result
-<table>
-<tr>
-<th><i>Cell</i></th>
-<td>Value</td>
-</tr>
-</table>
-
-!! end
!! test
Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html)
<table>
<tr>
<td>[<a rel="nofollow" class="external free" href="ftp://%7Cx">ftp://%7Cx</a></td>
-<td>]" onmouseover="alert(document.cookie)">test</td>
+<td>]" onmouseover="alert(document.cookie)">test
+</td>
</tr>
</table>
!! end
+
!! test
-Indented Tables, bug 20078
+Indented table markup mixed with indented pre content (proposed in bug 6200)
!! input
-: {|
-| 1 || 2
-|-
-| 3 || 4
-|}
+ <table>
+ <tr>
+ <td>
+ Text that should be rendered preformatted
+ </td>
+ </tr>
+ </table>
!! result
-<dl><dd><table>
-<tr>
-<td>1</td>
-<td>2</td>
-</tr>
-<tr>
-<td>3</td>
-<td>4</td>
-</tr>
-</table></dd></dl>
+ <table>
+ <tr>
+ <td>
+<pre>Text that should be rendered preformatted
+</pre>
+ </td>
+ </tr>
+ </table>
!! end
+
+
###
### Internal links
###
!! input
[[Main Page]]
!! result
-<p><a href="/wiki/Main_Page">Main Page</a>
+<p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
</p>
!! end
!! input
[[main Page]]
!! result
-<p><a href="/wiki/Main_Page">main Page</a>
+<p><a href="/wiki/Main_Page" title="Main Page">main Page</a>
</p>
!! end
!! input
xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
!! result
-<p>xxx<a href="/wiki/Main_Page">main Page</a>, xxx<a href="/wiki/Main_Page">Main Page</a>, Xxx<a href="/wiki/Main_Page">main Page</a> XXX<a href="/wiki/Main_Page">main Page</a>, XXX<a href="/wiki/Main_Page">Main Page</a>
+<p>xxx<a href="/wiki/Main_Page" title="Main Page">main Page</a>, xxx<a href="/wiki/Main_Page" title="Main Page">Main Page</a>, Xxx<a href="/wiki/Main_Page" title="Main Page">main Page</a> XXX<a href="/wiki/Main_Page" title="Main Page">main Page</a>, XXX<a href="/wiki/Main_Page" title="Main Page">Main Page</a>
</p>
!! end
!! input
[[Main Page]]xxx, [[Main Page]]XXX, [[Main Page]]!!!
!! result
-<p><a href="/wiki/Main_Page" title="Main Page">Main Pagexxx</a>, <a href="/wiki/Main_Page">Main Page</a>XXX, <a href="/wiki/Main_Page">Main Page</a>!!!
+<p><a href="/wiki/Main_Page" title="Main Page">Main Pagexxx</a>, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>XXX, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>!!!
</p>
!! end
</p>
!! end
+!! test
+Plain link to URL with link text
+!! input
+[[http://www.example.com Link text]]
+!! result
+<p>[<a rel="nofollow" class="external text" href="http://www.example.com">Link text</a>]
+</p>
+!! end
+
+!! test
+Plain link to protocol-relative URL
+!! input
+[[//www.example.com]]
+!! result
+<p>[<a rel="nofollow" class="external autonumber" href="//www.example.com">[1]</a>]
+</p>
+!! end
+
+!! test
+Plain link to protocol-relative URL with link text
+!! input
+[[//www.example.com Link text]]
+!! result
+<p>[<a rel="nofollow" class="external text" href="//www.example.com">Link text</a>]
+</p>
+!! end
+
+
# I'm fairly sure the expected result here is wrong.
# We want these to be URL links, not pseudo-pages with URLs for titles....
# However the current output is also pretty screwy.
!!input
[[00]]
!!result
-<p><a href="/wiki/00">00</a>
+<p><a href="/wiki/00" title="00">00</a>
</p>
!!end
!! input
'''[[Main Page]]'''
!! result
-<p><b><a href="/wiki/Main_Page">Main Page</a></b>
+<p><b><a href="/wiki/Main_Page" title="Main Page">Main Page</a></b>
</p>
!! end
!! input
''[[Main Page]]''
!! result
-<p><i><a href="/wiki/Main_Page">Main Page</a></i>
+<p><i><a href="/wiki/Main_Page" title="Main Page">Main Page</a></i>
</p>
!! end
!! input
[[MeatBall:SoftSecurity]]
!! result
-<p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class="extiw">MeatBall:SoftSecurity</a>
+<p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class="extiw" title="meatball:SoftSecurity">MeatBall:SoftSecurity</a>
</p>
!! end
!! input
[[MeatBall:]]
!! result
-<p><a href="http://www.usemod.com/cgi-bin/mb.pl?" class="extiw">MeatBall:</a>
+<p><a href="http://www.usemod.com/cgi-bin/mb.pl" class="extiw" title="meatball:">MeatBall:</a>
</p>
!! end
!! test
Failing to transform badly formed HTML into correct XHTML
!! input
-<br clear=left>
-<br clear=right>
-<br clear=all>
+<br style="clear: left;">
+<br style="clear: right;">
+<br style="clear: both;">
!! result
-<p><br clear="left" />
-<br clear="right" />
-<br clear="all" />
+<p><br style="clear: left;" />
+<br style="clear: right;" />
+<br style="clear: both;" />
</p>
!!end
!! input
RFC 822
!! result
-<p><a class="external mw-magiclink-rfc" href="http://tools.ietf.org/html/rfc822">RFC 822</a>
+<p><a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc822">RFC 822</a>
</p>
!! end
!! input
PMID 1234
!! result
-<p><a class="external mw-magiclink-pmid" href="http://www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a>
+<p><a class="external mw-magiclink-pmid" href="//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a>
</p>
!! end
!! result
<table>
<tr>
-<td>[[{{{1}}}|{{{2}}}]]</td>
-</tr>
-</table>
+<td>[[{{{1}}}|{{{2}}}]]
+</td></tr></table>
!! end
!! input
[[{{linktest2}}]]
!! result
-<p><a href="/wiki/Main_Page">Main Page</a>
+<p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
</p>
!! end
!! input
{{loop1}}
!! result
-<p><span class="error">Template loop detected: <a href="/wiki/Template:Loop1">Template:Loop1</a></span>
+<p><span class="error">Template loop detected: <a href="/wiki/Template:Loop1" title="Template:Loop1">Template:Loop1</a></span>
</p>
!! end
</p>
<table>
<tr>
-<td>1</td>
-<td>2</td>
-</tr>
+<td> 1 </td>
+<td> 2
+</td></tr>
<tr>
-<td>3</td>
-<td>4</td>
-</tr>
-</table>
+<td> 3 </td>
+<td> 4
+</td></tr></table>
!! end
</p>
<table>
<tr>
-<td>1</td>
-<td>2</td>
-</tr>
+<td> 1 </td>
+<td> 2
+</td></tr>
<tr>
-<td>3</td>
-<td>4</td>
-</tr>
-</table>
+<td> 3 </td>
+<td> 4
+</td></tr></table>
!! end
[[Ns:Article, Context|Article]]
!! end
+!! test
+pre-save transform: context links ("pipe trick") with full-width parens and no space (Japanese and Chinese style, bug 30149)
+!! options
+pst
+!! input
+[[Article(context)|]]
+[[Bar:Article(context)|]]
+[[:Bar:Article(context)|]]
+[[|Article(context)]]
+[[Bar:X (Y) Z|]]
+[[:Bar:X (Y) Z|]]
+!! result
+[[Article(context)|Article]]
+[[Bar:Article(context)|Article]]
+[[:Bar:Article(context)|Article]]
+[[Article(context)]]
+[[Bar:X (Y) Z|X (Y) Z]]
+[[:Bar:X (Y) Z|X (Y) Z]]
+!! end
+
+!! test
+pre-save transform: context links ("pipe trick") with full-width parens and space (Japanese and Chinese style, bug 30149)
+!! options
+pst
+!! input
+[[Article (context)|]]
+[[Bar:Article (context)|]]
+[[:Bar:Article (context)|]]
+[[|Article (context)]]
+[[Bar:X (Y) Z|]]
+[[:Bar:X (Y) Z|]]
+!! result
+[[Article (context)|Article]]
+[[Bar:Article (context)|Article]]
+[[:Bar:Article (context)|Article]]
+[[Article (context)]]
+[[Bar:X (Y) Z|X (Y) Z]]
+[[:Bar:X (Y) Z|X (Y) Z]]
+!! end
+
+!! test
+pre-save transform: context links ("pipe trick") with parens and no space (Korean style, bug 30149)
+!! options
+pst
+!! input
+[[Article(context)|]]
+[[Bar:Article(context)|]]
+[[:Bar:Article(context)|]]
+[[|Article(context)]]
+[[Bar:X(Y)Z|]]
+[[:Bar:X(Y)Z|]]
+!! result
+[[Article(context)|Article]]
+[[Bar:Article(context)|Article]]
+[[:Bar:Article(context)|Article]]
+[[Article(context)]]
+[[Bar:X(Y)Z|X(Y)Z]]
+[[:Bar:X(Y)Z|X(Y)Z]]
+!! end
+
+!! test
+pre-save transform: trim trailing empty lines
+!! options
+pst
+!! input
+Empty lines are trimmed
+
+
+
+
+!! result
+Empty lines are trimmed
+!! end
+
+!! test
+pre-save transform: Signature expansion
+!! options
+pst
+!! input
+* ~~~
+* <noinclude>~~~</noinclude>
+* <includeonly>~~~</includeonly>
+* <onlyinclude>~~~</onlyinclude>
+!! result
+* [[Special:Contributions/127.0.0.1|127.0.0.1]]
+* <noinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</noinclude>
+* <includeonly>[[Special:Contributions/127.0.0.1|127.0.0.1]]</includeonly>
+* <onlyinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</onlyinclude>
+!! end
+
+
+!! test
+pre-save transform: Signature expansion in nowiki tags (bug 93)
+!! options
+pst disabled
+!! input
+Shall not expand:
+
+<nowiki>~~~~</nowiki>
+
+<includeonly><nowiki>~~~~</nowiki></includeonly>
+
+<noinclude><nowiki>~~~~</nowiki></noinclude>
+
+<onlyinclude><nowiki>~~~~</nowiki></onlyinclude>
+
+{{subst:Foo}} shall be converted to FOO
+
+As well as inside noinclude/onlyinclude
+<noinclude>{{subst:Foo}}</noinclude>
+<onlyinclude>{{subst:Foo}}</onlyinclude>
+
+But not inside includeonly
+<includeonly>{{subst:Foo}}</includeonly>
+!! result
+Shall not expand:
+
+<nowiki>~~~~</nowiki>
+
+<includeonly><nowiki>~~~~</nowiki></includeonly>
+
+<noinclude><nowiki>~~~~</nowiki></noinclude>
+
+<onlyinclude><nowiki>~~~~</nowiki></onlyinclude>
+
+FOO shall be converted to FOO
+
+As well as inside noinclude/onlyinclude
+<noinclude>FOO</noinclude>
+<onlyinclude>FOO</onlyinclude>
+
+But not inside includeonly
+<includeonly>{{subst:Foo}}</includeonly>
+!! end
###
### Message transform tests
!! input
[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
!! result
-<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page">Main Page</a></div></div></div>
+<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
!! end
!! input
[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]]
!! result
-<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Altitude" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page">Main Page</a></div></div></div>
+<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Altitude" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
!! end
!! input
[[Image:foobar.jpg|thumb|This is RFC 12354]]
!! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a class="external mw-magiclink-rfc" href="http://tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div>
!! end
!! input
[[Image:Barfoo.jpg]]
!! result
-<p><a href="/wiki/File:Barfoo.jpg">File:Barfoo.jpg</a>
+<p><a href="/wiki/File:Barfoo.jpg" title="File:Barfoo.jpg">File:Barfoo.jpg</a>
</p>
!! end
!! input
[[Image:Foobaz.jpg]]
!! result
-<p><a href="/wiki/File:Foobaz.jpg">File:Foobaz.jpg</a>
+<p><a href="/wiki/File:Foobaz.jpg" title="File:Foobaz.jpg">File:Foobaz.jpg</a>
</p>
!! end
!! input
[[:Category:MediaWiki User's Guide]]
!! result
-<p><a href="/wiki/Category:MediaWiki_User%27s_Guide">Category:MediaWiki User's Guide</a>
+<p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
</p>
!! end
!! test
div with illegal double attributes
!! input
-<div align="center" align="right">HTML rocks</div>
+<div id="a" id="b">HTML rocks</div>
!! result
-<div align="right">HTML rocks</div>
+<div id="b">HTML rocks</div>
!!end
!! result
<table>
<tr>
-<th class="awesome">status</th>
-</tr>
-</table>
+<th class="awesome"> status
+</th></tr></table>
!!end
!! test
DIV IN UPPERCASE
!! input
-<DIV ALIGN="center">HTML ROCKS</DIV>
+<DIV ID="x">HTML ROCKS</DIV>
!! result
-<div align="center">HTML ROCKS</div>
+<div id="x">HTML ROCKS</div>
!!end
<a href="/wiki/%D7%90%D6%B7" title="אַ">אַ</a>
<a href="/wiki/%D7%90%D6%B7" title="אַ">אַ</a>
<a href="/wiki/%D7%90%D6%B7" title="אַ">אַ</a>
-<a href="/wiki/%D7%90%D6%B7">אַ</a>
+<a href="/wiki/%D7%90%D6%B7" title="אַ">אַ</a>
</p>
!! end
!! input
[[Main Page]]]
!! result
-<p><a href="/wiki/Main_Page">Main Page</a>]
+<p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>]
</p>
!! end
!! result
<table>
<tr>
-<th style="color:blue">status</th>
-</tr>
-</table>
+<th style="color:blue"> status
+</th></tr></table>
!!end
!! result
<table>
<tr>
-<th style="/* insecure input */">status</th>
-</tr>
-</table>
+<th style="/* insecure input */"> status
+</th></tr></table>
!! end
Something need to be done. foo-2 ?
!! end
+!! test
+Sanitizer: Validating that <meta> and <link> work, but only for Microdata
+!! input
+<div itemscope>
+ <meta itemprop="hello" content="world">
+ <meta http-equiv="refresh" content="5">
+ <link itemprop="hello" href="{{SERVER}}">
+ <link rel="stylesheet" href="{{SERVER}}">
+</div>
+!! result
+<div itemscope="itemscope">
+<p> <meta itemprop="hello" content="world" />
+ <meta http-equiv="refresh" content="5">
+</p>
+ <link itemprop="hello" href="http://Britney-Spears" />
+ <link rel="stylesheet" href="<a rel="nofollow" class="external free" href="http://Britney-Spears">http://Britney-Spears</a>">
+</div>
+
+!! end
+
!! test
Language converter: output gets cut off unexpectedly (bug 5757)
!! options
!! result
<table>
<tr>
-<td></td>
+<td>
+</td>
</tr>
</table>
!! input
==a==
{| STYLE=__TOC__
-|foo
!! result
<h2><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: a">edit</a>]</span> <span class="mw-headline" id="a">a</span></h2>
<table style="__TOC__">
-<tr>
-<td>foo</td>
-</tr>
+<tr><td></td></tr>
</table>
!! end
<th>https://</th>
<th></th>
<th></th>
-<th></th>
+<th>
+</td>
</tr>
</table>
!! result
<table>
<tr>
-<th><a rel="nofollow" class="external free" href="irc://{{ftp://a">irc://{{ftp://a</a>" onmouseover="alert('hello world');"</th>
-<td></td>
+<th> <a rel="nofollow" class="external free" href="irc://{{ftp://a">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
+</th>
+<td>
+</td>
</tr>
</table>
http://===r:::https://b
{|
-
!!result
<p><a rel="nofollow" class="external free" href="http://===r:::https://b">http://===r:::https://b</a>
</p>
+<table>
+<tr><td></td></tr>
+</table>
!! end
-# Known to produce bad XML for now
-
-# Note: the current result listed for this is not what the original one was,
-# but the original bug was JavaScript injection, which is fixed in any case.
-# It's not clear that the original result listed was any more correct than the
-# current one. Original result:
-# <table>
-# {{{|
-# <u class="|">}}}} >
-# <br style="onmouseover='alert(document.cookie);'" />
-#
-# MOVE YOUR MOUSE CURSOR OVER THIS TEXT
-# <tr>
-# <td></u>
-# </td>
-# </tr>
-# </table>
# Known to produce bad XML for now
!! test
Fuzz testing: Parser24
MOVE YOUR MOUSE CURSOR OVER THIS TEXT
|
!! result
-<p>{{{|
-</p><p><u class="|">}}}} >
-</p><p><br style="onmouseover='alert(document.cookie);'" />
-</p><p><br />
-MOVE YOUR MOUSE CURSOR OVER THIS TEXT
-</p>
<table>
+{{{|
+<u class="|">}}}} >
+<br style="onmouseover='alert(document.cookie);'" />
+
+MOVE YOUR MOUSE CURSOR OVER THIS TEXT
<tr>
-<td></u></td>
+<td></u>
+</td>
</tr>
</table>
!! result
<p><br />
</p>
-<table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx">Xyzzyx</a></td></tr></table>
+<table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
!! end
!! result
<p><br />
</p>
-<table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx">Xyzzyx</a></td></tr></table>
+<table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
<p><br />
</p>
-<table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx">Xyzzyx</a></td></tr></table>
+<table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
!! end
!! input
{{Special:search}}
!! result
-<p><a href="/wiki/Special:Search">Special:Search</a>
+<p><a href="/wiki/Special:Search" title="Special:Search">Special:Search</a>
</p>
!! end
!! test
Gallery (with options)
!! input
-<gallery widths='60px' heights='40px' perrow='2' caption='Foo [[Main Page]]' >
+<gallery widths='70px' heights='40px' perrow='2' caption='Foo [[Main Page]]' >
File:Nonexistant.jpg|caption
File:Nonexistant.jpg
image:foobar.jpg|some '''caption''' [[Main Page]]
image:foobar.jpg
+image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
</gallery>
!! result
-<ul class="gallery" style="max-width: 202px;_width: 202px;">
- <li class='gallerycaption'>Foo <a href="/wiki/Main_Page">Main Page</a></li>
- <li class="gallerybox" style="width: 95px"><div style="width: 95px">
+<ul class="gallery" style="max-width: 226px;_width: 226px;">
+ <li class='gallerycaption'>Foo <a href="/wiki/Main_Page" title="Main Page">Main Page</a></li>
+ <li class="gallerybox" style="width: 105px"><div style="width: 105px">
<div style="height: 70px;">Nonexistant.jpg</div>
<div class="gallerytext">
<p>caption
</p>
</div>
</div></li>
- <li class="gallerybox" style="width: 95px"><div style="width: 95px">
+ <li class="gallerybox" style="width: 105px"><div style="width: 105px">
<div style="height: 70px;">Nonexistant.jpg</div>
<div class="gallerytext">
</div>
</div></li>
- <li class="gallerybox" style="width: 95px"><div style="width: 95px">
- <div class="thumb" style="width: 90px;"><div style="margin:26px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="60" height="7" /></a></div></div>
+ <li class="gallerybox" style="width: 105px"><div style="width: 105px">
+ <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="70" height="8" /></a></div></div>
+ <div class="gallerytext">
+<p>some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
+</p>
+ </div>
+ </div></li>
+ <li class="gallerybox" style="width: 105px"><div style="width: 105px">
+ <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="70" height="8" /></a></div></div>
+ <div class="gallerytext">
+ </div>
+ </div></li>
+ <li class="gallerybox" style="width: 105px"><div style="width: 105px">
+ <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="This is a foo-bar." src="http://example.com/images/3/3a/Foobar.jpg" width="70" height="8" /></a></div></div>
+ <div class="gallerytext">
+<p>Blabla|blabla.
+</p>
+ </div>
+ </div></li>
+</ul>
+
+!! end
+
+!! test
+Gallery with wikitext inside caption
+!! input
+<gallery>
+File:foobar.jpg|[[File:foobar.jpg|20px|desc|alt=inneralt]]|alt=galleryalt
+File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt
+</gallery>
+!! result
+<ul class="gallery">
+ <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
<div class="gallerytext">
-<p>some <b>caption</b> <a href="/wiki/Main_Page">Main Page</a>
+<p><a href="/wiki/File:Foobar.jpg" class="image" title="desc"><img alt="inneralt" src="http://example.com/images/3/3a/Foobar.jpg" width="20" height="2" /></a>
</p>
</div>
</div></li>
- <li class="gallerybox" style="width: 95px"><div style="width: 95px">
- <div class="thumb" style="width: 90px;"><div style="margin:26px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="60" height="7" /></a></div></div>
+ <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
<div class="gallerytext">
+<p>This is a test template
+</p>
</div>
</div></li>
</ul>
</div>
</div></li>
<li class="gallerybox" style="width: 155px"><div style="width: 155px">
- <div class="thumb" style="width: 150px;"><div style="margin:66px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
<div class="gallerytext">
<p><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br />
-some <b>caption</b> <a href="/wiki/Main_Page">Main Page</a>
+some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
</p>
</div>
</div></li>
<li class="gallerybox" style="width: 155px"><div style="width: 155px">
- <div class="thumb" style="width: 150px;"><div style="margin:66px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
<div class="gallerytext">
<p><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br />
</p>
</div>
</div></li>
<li class="gallerybox" style="width: 155px"><div style="width: 155px">
- <div class="thumb" style="width: 150px;"><div style="margin:66px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
<div class="gallerytext">
</div>
</div></li>
<li class="gallerybox" style="width: 155px"><div style="width: 155px">
- <div class="thumb" style="width: 150px;"><div style="margin:66px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
<div class="gallerytext">
</div>
</div></li>
!! input
RFC RFC 1234
!! result
-<p>RFC <a class="external mw-magiclink-rfc" href="http://tools.ietf.org/html/rfc1234">RFC 1234</a>
+<p>RFC <a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc1234">RFC 1234</a>
</p>
!! end
!! input
RFC 983 987
!! result
-<p><a class="external mw-magiclink-rfc" href="http://tools.ietf.org/html/rfc983">RFC 983</a> 987
+<p><a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc983">RFC 983</a> 987
</p>
!! end
!! input
[[Main Page]] can be written as [[Маин Паге]] same as [[Маин Паге]].
!! result
-<p><a href="/wiki/Main_Page">Main Page</a> can be written as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a> same as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a>.
+<p><a href="/wiki/Main_Page" title="Main Page">Main Page</a> can be written as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a> same as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a>.
</p>
!!end
!! input
-{[[Main Page]]}-
!! result
-<p><a href="/wiki/Main_Page">Main Page</a>
+<p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
</p>
!! end
!! input
== -{Naslov}- ==
!! result
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Уреди део: Naslov">уреди</a>]</span> <span class="mw-headline" id="-.7BNaslov.7D-"> Naslov </span></h2>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Уредите одељак „Naslov“">уреди</a>]</span> <span class="mw-headline" id="-.7BNaslov.7D-"> Naslov </span></h2>
!! end
</p>
<table>
<tr>
-<td>1</td>
-<td>2</td>
-</tr>
+<td> 1 </td>
+<td> 2
+</td></tr>
<tr>
-<td>3</td>
-<td>4</td>
-</tr></table>
+<td> 3 </td>
+<td> 4
+</td></tr></table>
<p>y
</p>
!! end
[[meatball:2]]
[[meatball:3]]
!! result
-<p><a href="http://www.usemod.com/cgi-bin/mb.pl?1" class="extiw">meatball:1</a>
-<a href="http://www.usemod.com/cgi-bin/mb.pl?2" class="extiw">meatball:2</a>
-<a href="http://www.usemod.com/cgi-bin/mb.pl?3" class="extiw">meatball:3</a>
+<p><a href="http://www.usemod.com/cgi-bin/mb.pl?1" class="extiw" title="meatball:1">meatball:1</a>
+<a href="http://www.usemod.com/cgi-bin/mb.pl?2" class="extiw" title="meatball:2">meatball:2</a>
+<a href="http://www.usemod.com/cgi-bin/mb.pl?3" class="extiw" title="meatball:3">meatball:3</a>
</p>
!! end
!! input
I like the [[Main Page]] a lot
!! result
-I like the <a href="/wiki/Main_Page">Main Page</a> a lot
+I like the <a href="/wiki/Main_Page" title="Main Page">Main Page</a> a lot
!!end
!! test
!! input
/* External links */ removed bogus entries
!! result
-<span class="autocomment"><a href="/wiki/Main_Page#External_links" title="Main Page">→</a>External links: </span> removed bogus entries
+<a href="/wiki/Main_Page#External_links" title="Main Page">→</a><span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
!!end
!! test
!! input
/* External links */ removed bogus entries
!! result
-<span class="autocomment"><a href="#External_links">→</a>External links: </span> removed bogus entries
+<a href="#External_links">→</a><span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
!!end
!! test
!!input
/* __hello__world__ */
!! result
-<span class="autocomment"><a href="/wiki/Main_Page#hello_world" title="Main Page">→</a>__hello__world__</span>
+<a href="/wiki/Main_Page#hello_world" title="Main Page">→</a><span dir="auto"><span class="autocomment">__hello__world__</span></span>
!! end
!! test
!! test
Bad images - basic functionality
+!! options
+disabled
!! input
[[File:Bad.jpg]]
!! result
!! test
Bad images - bug 16039: text after bad image disappears
+!! options
+disabled
!! input
Foo bar
[[File:Bad.jpg]]
</p>
!! end
+
+!! test
+Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4)
+!! input
+Text's been normalized?
+!! result
+<p>Text's been normalized?
+</p>
+!! end
+
+!! test
+Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate free external links
+!! input
+http://www.example.org/ <-- U+3000 (vim: ^Vu3000)
+!! result
+<p><a rel="nofollow" class="external free" href="http://www.example.org/">http://www.example.org/</a> <-- U+3000 (vim: ^Vu3000)
+</p>
+!! end
+
+!! test
+Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links
+!! input
+[http://www.example.org/ ideograms]
+!! result
+<p><a rel="nofollow" class="external text" href="http://www.example.org/">ideograms</a>
+</p>
+!! end
+
+!! test
+Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate external images links
+!! input
+http://www.example.org/pic.png <-- U+3000 (vim: ^Vu3000)
+!! result
+<p><img src="http://www.example.org/pic.png" alt="pic.png" /> <-- U+3000 (vim: ^Vu3000)
+</p>
+!! end
+
+!! article
+Mediawiki:loop1
+!! text
+{{Identical|A}}
+!! endarticle
+
!! article
-A
+Mediawiki:loop2
!! text
-A
+{{Identical|B}}
!! endarticle
!! article
-Ä
+Template:Identical
!! text
-Ä
+{{int:loop1}}
+{{int:loop2}}
!! endarticle
!! test
-Bug#542 Link text shouldn't be duplicated in title attributes
+Bug 31098 Template which includes system messages which includes the template
+!! input
+{{Identical}}
+!! result
+<p><span class="error">Template loop detected: <a href="/wiki/Template:Identical" title="Template:Identical">Template:Identical</a></span>
+<span class="error">Template loop detected: <a href="/wiki/Template:Identical" title="Template:Identical">Template:Identical</a></span>
+</p>
+!! end
+
+!! test
+Deprecated presentational attributes are converted to css
+!! input
+{|
+| valign=top align=left width=100 height=25% | Asdf
+|}
+<ul type="disc"></ul>
+!! result
+<table>
+<tr>
+<td style="text-align: left; height: 25%; vertical-align: top; width: 100px;"> Asdf
+</td></tr></table>
+<ul style="list-style-type: disc;"></ul>
+
+!! end
+
+!! test
+Bug31490 Turkish: ucfirst 'blah'
+!! options
+language=tr
+!! input
+{{ucfirst:blah}}
+!! result
+<p>Blah
+</p>
+!! end
+
+!! test
+Bug31490 Turkish: ucfirst 'ix'
+!! options
+language=tr
+!! input
+{{ucfirst:ix}}
+!! result
+<p>İx
+</p>
+!! end
+
+!! test
+Bug31490 Turkish: lcfirst 'BLAH'
+!! options
+language=tr
+!! input
+{{lcfirst:BLAH}}
+!! result
+<p>bLAH
+</p>
+!! end
+
+!! test
+Bug31490 Turkish: ucfırst (with a dotless i)
+!! options
+language=tr
+!! input
+{{ucfırst:blah}}
+!! result
+<p><a href="/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&action=edit&redlink=1" class="new" title="Şablon:Ucfırst:blah (sayfa mevcut değil)">Şablon:Ucfırst:blah</a>
+</p>
+!! end
+
+!! test
+Bug31490 ucfırst (with a dotless i) with English language
+!! options
+language=en
+!! input
+{{ucfırst:blah}}
+!! result
+<p><a href="/index.php?title=Template:Ucf%C4%B1rst:blah&action=edit&redlink=1" class="new" title="Template:Ucfırst:blah (page does not exist)">Template:Ucfırst:blah</a>
+</p>
+!! end
+
+!! test
+Bug 26375: TOC with italics
+!! options
+title=[[Main Page]]
+!! input
+__TOC__
+== ''Lost'' episodes ==
+!! result
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Lost_episodes"><span class="tocnumber">1</span> <span class="toctext"><i>Lost</i> episodes</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Lost episodes">edit</a>]</span> <span class="mw-headline" id="Lost_episodes"> <i>Lost</i> episodes </span></h2>
+
+!! end
+
+!! test
+Bug 26375: TOC with bold
+!! options
+title=[[Main Page]]
+!! input
+__TOC__
+== '''should be bold''' then normal text ==
+!! result
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#should_be_bold_then_normal_text"><span class="tocnumber">1</span> <span class="toctext"><b>should be bold</b> then normal text</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: should be bold then normal text">edit</a>]</span> <span class="mw-headline" id="should_be_bold_then_normal_text"> <b>should be bold</b> then normal text </span></h2>
+
+!! end
+
+!! test
+Bug 33845: Headings become cursive in TOC when they contain an image
+!! options
+title=[[Main Page]]
+!! input
+__TOC__
+== Image [[Image:foobar.jpg]] ==
+!! result
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Image"><span class="tocnumber">1</span> <span class="toctext">Image</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Image">edit</a>]</span> <span class="mw-headline" id="Image"> Image <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </span></h2>
+
+!! end
+
+!! test
+Bug 33845 (2): Headings become bold in TOC when they contain a blockquote
+!! options
+title=[[Main Page]]
+!! input
+__TOC__
+== <blockquote>Quote</blockquote> ==
+!! result
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Quote"><span class="tocnumber">1</span> <span class="toctext">Quote</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Quote">edit</a>]</span> <span class="mw-headline" id="Quote"> <blockquote>Quote</blockquote> </span></h2>
+
+!! end
+
+!! test
+Unclosed tags in TOC
+!! options
+title=[[Main Page]]
!! input
-[[A]] [[a]] [[Ä]] [[ä]]
+__TOC__
+== Proof: 2 < 3 ==
+<small>Hanc marginis exiguitas non caperet.</small>
+QED
!! result
-<p><a href="/wiki/A">A</a> <a href="/wiki/A">a</a> <a href="/wiki/%C3%84">Ä</a> <a href="/wiki/%C3%84">ä</a>
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Proof:_2_.3C_3"><span class="tocnumber">1</span> <span class="toctext">Proof: 2 < 3</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Proof: 2 < 3">edit</a>]</span> <span class="mw-headline" id="Proof:_2_.3C_3"> Proof: 2 < 3 </span></h2>
+<p><small>Hanc marginis exiguitas non caperet.</small>
+QED
</p>
!! end
+!! test
+Multiple tags in TOC
+!! input
+__TOC__
+== <i>Foo</i> <b>Bar</b> ==
+
+== <i>Foo</i> <blockquote>Bar</blockquote> ==
+!! result
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Foo_Bar"><span class="tocnumber">1</span> <span class="toctext"><i>Foo</i> <b>Bar</b></span></a></li>
+<li class="toclevel-1 tocsection-2"><a href="#Foo_Bar_2"><span class="tocnumber">2</span> <span class="toctext"><i>Foo</i> Bar</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar"> <i>Foo</i> <b>Bar</b> </span></h2>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar_2"> <i>Foo</i> <blockquote>Bar</blockquote> </span></h2>
+
+!! end
+
+!! test
+Tags with parameters in TOC
+!! input
+__TOC__
+== <sup class="in-h2">Hello</sup> ==
+
+== <sup class="a > b">Evilbye</sup> ==
+!! result
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Hello"><span class="tocnumber">1</span> <span class="toctext"><sup>Hello</sup></span></a></li>
+<li class="toclevel-1 tocsection-2"><a href="#b.22.3EEvilbye"><span class="tocnumber">2</span> <span class="toctext"><sup> b">Evilbye</sup></span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Hello">edit</a>]</span> <span class="mw-headline" id="Hello"> <sup class="in-h2">Hello</sup> </span></h2>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: b">Evilbye">edit</a>]</span> <span class="mw-headline" id="b.22.3EEvilbye"> <sup> b">Evilbye</sup> </span></h2>
+
+!! end
+
+!! article
+MediaWiki:Bug32057
+!! text
+== {{int:headline_sample}} ==
+!! endarticle
+
+!! test
+Bug 32057: Title needed when expanding <h> nodes.
+!! options
+title=[[Main Page]]
+!! input
+{{int:Bug32057}}
+!! result
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Headline text">edit</a>]</span> <span class="mw-headline" id="Headline_text"> Headline text </span></h2>
+
+!! end
+
TODO:
more images
more tables