Sync up with Parsoid parserTests.
[lhc/web/wiklou.git] / tests / parser / parserTests.txt
index a868214..0a2e87f 100644 (file)
@@ -157,23 +157,23 @@ Template:OpenTable
 ###
 !! test
 Blank input
 ###
 !! test
 Blank input
-!! input
-!! result
+!! wikitext
+!! html
 !! end
 
 
 !! test
 Simple paragraph
 !! end
 
 
 !! test
 Simple paragraph
-!! input
+!! wikitext
 This is a simple paragraph.
 This is a simple paragraph.
-!! result
+!! html
 <p>This is a simple paragraph.
 </p>
 !! end
 
 !! test
 Paragraphs with extra newline spacing
 <p>This is a simple paragraph.
 </p>
 !! end
 
 !! test
 Paragraphs with extra newline spacing
-!! input
+!! wikitext
 foo
 
 bar
 foo
 
 bar
@@ -184,7 +184,7 @@ baz
 
 
 booz
 
 
 booz
-!! result
+!! html
 <p>foo
 </p><p>bar
 </p><p><br />
 <p>foo
 </p><p>bar
 </p><p><br />
@@ -196,7 +196,7 @@ baz
 
 !! test
 Paragraphs with newline spacing with comment lines in between
 
 !! test
 Paragraphs with newline spacing with comment lines in between
-!! input
+!! wikitext
 ----
 a
 <!--foo-->
 ----
 a
 <!--foo-->
@@ -232,7 +232,7 @@ a
 <!--foo-->
 b
 ----
 <!--foo-->
 b
 ----
-!! result
+!! html
 <hr />
 <p>a
 b
 <hr />
 <p>a
 b
@@ -269,7 +269,7 @@ b
 
 !! test
 Paragraphs with newline spacing with non-empty white-space lines in between
 
 !! test
 Paragraphs with newline spacing with non-empty white-space lines in between
-!! input
+!! wikitext
 ----
 a
  
 ----
 a
  
@@ -280,7 +280,7 @@ a
  
 b
 ----
  
 b
 ----
-!! result
+!! html
 <hr />
 <p>a
 </p><p>b
 <hr />
 <p>a
 </p><p>b
@@ -296,7 +296,7 @@ b
 
 !! test
 Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between
 
 !! test
 Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between
-!! input
+!! wikitext
 ----
 a
  <!--foo-->
 ----
 a
  <!--foo-->
@@ -319,7 +319,7 @@ a
  
 b
 ----
  
 b
 ----
-!! result
+!! html
 <hr />
 <p>a
 b
 <hr />
 <p>a
 b
@@ -343,13 +343,13 @@ b
 
 !! test
 Extra newlines: More paragraphs with indented comment
 
 !! test
 Extra newlines: More paragraphs with indented comment
-!! input
+!! wikitext
 a
 
    <!--boo-->
 
 b
 a
 
    <!--boo-->
 
 b
-!!result
+!! html
 <p>a
 </p><p><br />
 b
 <p>a
 </p><p><br />
 b
@@ -358,7 +358,7 @@ b
 
 !! test
 Extra newlines followed by heading
 
 !! test
 Extra newlines followed by heading
-!! input
+!! wikitext
 a
 
 
 a
 
 
@@ -368,7 +368,7 @@ a
 
 
 =b=
 
 
 =b=
-!! result
+!! html
 <p>a
 </p><p><br />
 </p>
 <p>a
 </p><p><br />
 </p>
@@ -382,13 +382,13 @@ a
 
 !! test
 Extra newlines between heading and content are swallowed
 
 !! test
 Extra newlines between heading and content are swallowed
-!! input
+!! wikitext
 =b=
 
 
 
 [[a]]
 =b=
 
 
 
 [[a]]
-!! result
+!! html
 <h1><span class="mw-headline" id="b">b</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: b">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
 <p><a href="/index.php?title=A&amp;action=edit&amp;redlink=1" class="new" title="A (page does not exist)">a</a>
 </p>
 <h1><span class="mw-headline" id="b">b</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: b">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
 <p><a href="/index.php?title=A&amp;action=edit&amp;redlink=1" class="new" title="A (page does not exist)">a</a>
 </p>
@@ -396,20 +396,20 @@ Extra newlines between heading and content are swallowed
 
 !! test
 Parsing an URL
 
 !! test
 Parsing an URL
-!! input
+!! wikitext
 http://fr.wikipedia.org/wiki/🍺
 <!-- EasterEgg we love beer, better be able be able to link to it -->
 http://fr.wikipedia.org/wiki/🍺
 <!-- EasterEgg we love beer, better be able be able to link to it -->
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://fr.wikipedia.org/wiki/🍺">http://fr.wikipedia.org/wiki/🍺</a>
 </p>
 !! end
 
 !! test
 Simple list
 <p><a rel="nofollow" class="external free" href="http://fr.wikipedia.org/wiki/🍺">http://fr.wikipedia.org/wiki/🍺</a>
 </p>
 !! end
 
 !! test
 Simple list
-!! input
+!! wikitext
 * Item 1
 * Item 2
 * Item 1
 * Item 2
-!! result
+!! html
 <ul>
 <li> Item 1
 </li>
 <ul>
 <li> Item 1
 </li>
@@ -421,7 +421,7 @@ Simple list
 
 !! test
 Italics and bold
 
 !! test
 Italics and bold
-!! input
+!! wikitext
 * plain
 * plain''italic''plain
 * plain''italic''plain''italic''plain
 * plain
 * plain''italic''plain
 * plain''italic''plain''italic''plain
@@ -437,7 +437,7 @@ Italics and bold
 * plain'''bold''bold-italic'''''plain
 * plain l'''italic''plain
 * plain l''''bold''' plain
 * plain'''bold''bold-italic'''''plain
 * plain l'''italic''plain
 * plain l''''bold''' plain
-!! result
+!! html
 <ul>
 <li> plain
 </li>
 <ul>
 <li> plain
 </li>
@@ -476,9 +476,9 @@ Italics and bold
 # this example taken from the [[simple:Moon]] article (bug 47326)
 !! test
 Italics and possessives (1)
 # this example taken from the [[simple:Moon]] article (bug 47326)
 !! test
 Italics and possessives (1)
-!! input
+!! wikitext
 obtained by ''[[Lunar Prospector]]'''s gamma-ray spectrometer
 obtained by ''[[Lunar Prospector]]'''s gamma-ray spectrometer
-!! result
+!! html
 <p>obtained by <i><a href="/index.php?title=Lunar_Prospector&amp;action=edit&amp;redlink=1" class="new" title="Lunar Prospector (page does not exist)">Lunar Prospector</a>'</i>s gamma-ray spectrometer
 </p>
 !! end
 <p>obtained by <i><a href="/index.php?title=Lunar_Prospector&amp;action=edit&amp;redlink=1" class="new" title="Lunar Prospector (page does not exist)">Lunar Prospector</a>'</i>s gamma-ray spectrometer
 </p>
 !! end
@@ -486,9 +486,9 @@ obtained by ''[[Lunar Prospector]]'''s gamma-ray spectrometer
 # this example taken from [[en:Flaming Pie]] (bug 49926)
 !! test
 Italics and possessives (2)
 # this example taken from [[en:Flaming Pie]] (bug 49926)
 !! test
 Italics and possessives (2)
-!! input
+!! wikitext
 '''''Flaming Pie''''' is ... released in 1997. In ''Flaming Pie'''s liner notes
 '''''Flaming Pie''''' is ... released in 1997. In ''Flaming Pie'''s liner notes
-!! result
+!! html
 <p><i><b>Flaming Pie</b></i> is ... released in 1997. In <i>Flaming Pie'</i>s liner notes
 </p>
 !! end
 <p><i><b>Flaming Pie</b></i> is ... released in 1997. In <i>Flaming Pie'</i>s liner notes
 </p>
 !! end
@@ -496,9 +496,9 @@ Italics and possessives (2)
 # this example taken from [[en:Dictionary]] (bug 49926)
 !! test
 Italics and possessives (3)
 # this example taken from [[en:Dictionary]] (bug 49926)
 !! test
 Italics and possessives (3)
-!! input
+!! wikitext
 The first monolingual dictionary written in a Romance language was ''Sebastián Covarrubias''' ''Tesoro de la lengua castellana o española'', published in 1611 in Madrid. In 1612 the first edition of the ''Vocabolario dell'[[Accademia della Crusca]]'', for Italian, was published. In 1690 in Rotterdam was published, posthumously, the ''Dictionnaire Universel''.
 The first monolingual dictionary written in a Romance language was ''Sebastián Covarrubias''' ''Tesoro de la lengua castellana o española'', published in 1611 in Madrid. In 1612 the first edition of the ''Vocabolario dell'[[Accademia della Crusca]]'', for Italian, was published. In 1690 in Rotterdam was published, posthumously, the ''Dictionnaire Universel''.
-!! result
+!! html
 <p>The first monolingual dictionary written in a Romance language was <i>Sebastián Covarrubias'</i> <i>Tesoro de la lengua castellana o española</i>, published in 1611 in Madrid. In 1612 the first edition of the <i>Vocabolario dell'<a href="/index.php?title=Accademia_della_Crusca&amp;action=edit&amp;redlink=1" class="new" title="Accademia della Crusca (page does not exist)">Accademia della Crusca</a></i>, for Italian, was published. In 1690 in Rotterdam was published, posthumously, the <i>Dictionnaire Universel</i>.
 </p>
 !! end
 <p>The first monolingual dictionary written in a Romance language was <i>Sebastián Covarrubias'</i> <i>Tesoro de la lengua castellana o española</i>, published in 1611 in Madrid. In 1612 the first edition of the <i>Vocabolario dell'<a href="/index.php?title=Accademia_della_Crusca&amp;action=edit&amp;redlink=1" class="new" title="Accademia della Crusca (page does not exist)">Accademia della Crusca</a></i>, for Italian, was published. In 1690 in Rotterdam was published, posthumously, the <i>Dictionnaire Universel</i>.
 </p>
 !! end
@@ -509,9 +509,9 @@ The first monolingual dictionary written in a Romance language was ''Sebastián
 ###
 !! test
 Italics and bold: 2-quote opening sequence: (2,2)
 ###
 !! test
 Italics and bold: 2-quote opening sequence: (2,2)
-!! input
+!! wikitext
 ''foo''
 ''foo''
-!! result
+!! html
 <p><i>foo</i>
 </p>
 !!end
 <p><i>foo</i>
 </p>
 !!end
@@ -519,9 +519,9 @@ Italics and bold: 2-quote opening sequence: (2,2)
 
 !! test
 Italics and bold: 2-quote opening sequence: (2,3)
 
 !! test
 Italics and bold: 2-quote opening sequence: (2,3)
-!! input
+!! wikitext
 ''foo'''
 ''foo'''
-!! result
+!! html
 <p><i>foo'</i>
 </p>
 !!end
 <p><i>foo'</i>
 </p>
 !!end
@@ -529,32 +529,23 @@ Italics and bold: 2-quote opening sequence: (2,3)
 
 !! test
 Italics and bold: 2-quote opening sequence: (2,4)
 
 !! test
 Italics and bold: 2-quote opening sequence: (2,4)
-!! input
+!! wikitext
 ''foo''''
 ''foo''''
-!! result
+!! html
 <p><i>foo''</i>
 </p>
 !!end
 
 
 <p><i>foo''</i>
 </p>
 !!end
 
 
+# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
 !! test
 !! test
-Italics and bold: 2-quote opening sequence: (2,5) (php)
-!! options
-php
-!! input
+Italics and bold: 2-quote opening sequence: (2,5)
+!! wikitext
 ''foo'''''
 ''foo'''''
-!! result
+!! html/php
 <p><i>foo</i>
 </p>
 <p><i>foo</i>
 </p>
-!!end
-# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
-!! test
-Italics and bold: 2-quote opening sequence: (2,5) (parsoid)
-!! options
-parsoid
-!! input
-''foo'''''
-!! result
+!! html/parsoid
 <p><i>foo</i><b></b>
 </p>
 !!end
 <p><i>foo</i><b></b>
 </p>
 !!end
@@ -566,9 +557,9 @@ parsoid
 
 !! test
 Italics and bold: 3-quote opening sequence: (3,2)
 
 !! test
 Italics and bold: 3-quote opening sequence: (3,2)
-!! input
+!! wikitext
 '''foo''
 '''foo''
-!! result
+!! html
 <p>'<i>foo</i>
 </p>
 !!end
 <p>'<i>foo</i>
 </p>
 !!end
@@ -576,9 +567,9 @@ Italics and bold: 3-quote opening sequence: (3,2)
 
 !! test
 Italics and bold: 3-quote opening sequence: (3,3)
 
 !! test
 Italics and bold: 3-quote opening sequence: (3,3)
-!! input
+!! wikitext
 '''foo'''
 '''foo'''
-!! result
+!! html
 <p><b>foo</b>
 </p>
 !!end
 <p><b>foo</b>
 </p>
 !!end
@@ -586,32 +577,23 @@ Italics and bold: 3-quote opening sequence: (3,3)
 
 !! test
 Italics and bold: 3-quote opening sequence: (3,4)
 
 !! test
 Italics and bold: 3-quote opening sequence: (3,4)
-!! input
+!! wikitext
 '''foo''''
 '''foo''''
-!! result
+!! html
 <p><b>foo'</b>
 </p>
 !!end
 
 
 <p><b>foo'</b>
 </p>
 !!end
 
 
+# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
 !! test
 !! test
-Italics and bold: 3-quote opening sequence: (3,5) (php)
-!! options
-php
-!! input
+Italics and bold: 3-quote opening sequence: (3,5)
+!! wikitext
 '''foo'''''
 '''foo'''''
-!! result
+!! html/php
 <p><b>foo</b>
 </p>
 <p><b>foo</b>
 </p>
-!!end
-# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
-!! test
-Italics and bold: 3-quote opening sequence: (3,5) (parsoid)
-!! options
-parsoid
-!! input
-'''foo'''''
-!! result
+!! html/parsoid
 <p><b>foo</b><i></i>
 </p>
 !!end
 <p><b>foo</b><i></i>
 </p>
 !!end
@@ -623,9 +605,9 @@ parsoid
 
 !! test
 Italics and bold: 4-quote opening sequence: (4,2)
 
 !! test
 Italics and bold: 4-quote opening sequence: (4,2)
-!! input
+!! wikitext
 ''''foo''
 ''''foo''
-!! result
+!! html
 <p>''<i>foo</i>
 </p>
 !!end
 <p>''<i>foo</i>
 </p>
 !!end
@@ -633,9 +615,9 @@ Italics and bold: 4-quote opening sequence: (4,2)
 
 !! test
 Italics and bold: 4-quote opening sequence: (4,3)
 
 !! test
 Italics and bold: 4-quote opening sequence: (4,3)
-!! input
+!! wikitext
 ''''foo'''
 ''''foo'''
-!! result
+!! html
 <p>'<b>foo</b>
 </p>
 !!end
 <p>'<b>foo</b>
 </p>
 !!end
@@ -643,32 +625,23 @@ Italics and bold: 4-quote opening sequence: (4,3)
 
 !! test
 Italics and bold: 4-quote opening sequence: (4,4)
 
 !! test
 Italics and bold: 4-quote opening sequence: (4,4)
-!! input
+!! wikitext
 ''''foo''''
 ''''foo''''
-!! result
+!! html
 <p>'<b>foo'</b>
 </p>
 !!end
 
 
 <p>'<b>foo'</b>
 </p>
 !!end
 
 
+# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
 !! test
 !! test
-Italics and bold: 4-quote opening sequence: (4,5) (php)
-!! options
-php
-!! input
+Italics and bold: 4-quote opening sequence: (4,5)
+!! wikitext
 ''''foo'''''
 ''''foo'''''
-!! result
+!! html/php
 <p>'<b>foo</b>
 </p>
 <p>'<b>foo</b>
 </p>
-!!end
-# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
-!! test
-Italics and bold: 4-quote opening sequence: (4,5) (parsoid)
-!! options
-parsoid
-!! input
-''''foo'''''
-!! result
+!! html/parsoid
 <p>'<b>foo</b><i></i>
 </p>
 !!end
 <p>'<b>foo</b><i></i>
 </p>
 !!end
@@ -681,9 +654,9 @@ parsoid
 !! test
 Italics and bold: 5-quote opening sequence: (5,2)
 !! options
 !! test
 Italics and bold: 5-quote opening sequence: (5,2)
 !! options
-!! input
+!! wikitext
 '''''foo''
 '''''foo''
-!! result
+!! html
 <p><b><i>foo</i></b>
 </p>
 !!end
 <p><b><i>foo</i></b>
 </p>
 !!end
@@ -691,9 +664,9 @@ Italics and bold: 5-quote opening sequence: (5,2)
 
 !! test
 Italics and bold: 5-quote opening sequence: (5,3)
 
 !! test
 Italics and bold: 5-quote opening sequence: (5,3)
-!! input
+!! wikitext
 '''''foo'''
 '''''foo'''
-!! result
+!! html
 <p><i><b>foo</b></i>
 </p>
 !!end
 <p><i><b>foo</b></i>
 </p>
 !!end
@@ -701,9 +674,9 @@ Italics and bold: 5-quote opening sequence: (5,3)
 
 !! test
 Italics and bold: 5-quote opening sequence: (5,4)
 
 !! test
 Italics and bold: 5-quote opening sequence: (5,4)
-!! input
+!! wikitext
 '''''foo''''
 '''''foo''''
-!! result
+!! html
 <p><i><b>foo'</b></i>
 </p>
 !!end
 <p><i><b>foo'</b></i>
 </p>
 !!end
@@ -711,9 +684,9 @@ Italics and bold: 5-quote opening sequence: (5,4)
 
 !! test
 Italics and bold: 5-quote opening sequence: (5,5)
 
 !! test
 Italics and bold: 5-quote opening sequence: (5,5)
-!! input
+!! wikitext
 '''''foo'''''
 '''''foo'''''
-!! result
+!! html
 <p><i><b>foo</b></i>
 </p>
 !!end
 <p><i><b>foo</b></i>
 </p>
 !!end
@@ -723,9 +696,9 @@ Italics and bold: 5-quote opening sequence: (5,5)
 ###
 !! test
 Italics and bold: multiple quote sequences: (2,4,2)
 ###
 !! test
 Italics and bold: multiple quote sequences: (2,4,2)
-!! input
+!! wikitext
 ''foo''''bar''
 ''foo''''bar''
-!! result
+!! html
 <p><i>foo'<b>bar</b></i>
 </p>
 !!end
 <p><i>foo'<b>bar</b></i>
 </p>
 !!end
@@ -733,9 +706,9 @@ Italics and bold: multiple quote sequences: (2,4,2)
 
 !! test
 Italics and bold: multiple quote sequences: (2,4,3)
 
 !! test
 Italics and bold: multiple quote sequences: (2,4,3)
-!! input
+!! wikitext
 ''foo''''bar'''
 ''foo''''bar'''
-!! result
+!! html
 <p><i>foo'<b>bar</b></i>
 </p>
 !!end
 <p><i>foo'<b>bar</b></i>
 </p>
 !!end
@@ -743,55 +716,37 @@ Italics and bold: multiple quote sequences: (2,4,3)
 
 !! test
 Italics and bold: multiple quote sequences: (2,4,4)
 
 !! test
 Italics and bold: multiple quote sequences: (2,4,4)
-!! input
+!! wikitext
 ''foo''''bar''''
 ''foo''''bar''''
-!! result
+!! html
 <p><i>foo'<b>bar'</b></i>
 </p>
 !!end
 
 
 <p><i>foo'<b>bar'</b></i>
 </p>
 !!end
 
 
+# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
 !! test
 !! test
-Italics and bold: multiple quote sequences: (3,4,2) (php)
-!! options
-php
-!! input
+Italics and bold: multiple quote sequences: (3,4,2)
+!! wikitext
 '''foo''''bar''
 '''foo''''bar''
-!! result
+!! html/php
 <p><b>foo'</b>bar
 </p>
 <p><b>foo'</b>bar
 </p>
-!!end
-# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
-!! test
-Italics and bold: multiple quote sequences: (3,4,2) (parsoid)
-!! options
-parsoid
-!! input
-'''foo''''bar''
-!! result
+!! html/parsoid
 <p><b>foo'</b>bar<i></i>
 </p>
 !!end
 
 
 <p><b>foo'</b>bar<i></i>
 </p>
 !!end
 
 
+# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
 !! test
 !! test
-Italics and bold: multiple quote sequences: (3,4,3) (php)
-!! options
-php
-!! input
+Italics and bold: multiple quote sequences: (3,4,3)
+!! wikitext
 '''foo''''bar'''
 '''foo''''bar'''
-!! result
+!! html/php
 <p><b>foo'</b>bar
 </p>
 <p><b>foo'</b>bar
 </p>
-!!end
-# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
-!! test
-Italics and bold: multiple quote sequences: (3,4,3) (parsoid)
-!! options
-parsoid
-!! input
-'''foo''''bar'''
-!! result
+!! html/parsoid
 <p><b>foo'</b>bar<b></b>
 </p>
 !!end
 <p><b>foo'</b>bar<b></b>
 </p>
 !!end
@@ -801,9 +756,9 @@ parsoid
 ###
 !! test
 Italics and bold: other quote tests: (2,3,5)
 ###
 !! test
 Italics and bold: other quote tests: (2,3,5)
-!! input
+!! wikitext
 ''this is about '''foo's family'''''
 ''this is about '''foo's family'''''
-!! result
+!! html
 <p><i>this is about <b>foo's family</b></i>
 </p>
 !!end
 <p><i>this is about <b>foo's family</b></i>
 </p>
 !!end
@@ -811,9 +766,9 @@ Italics and bold: other quote tests: (2,3,5)
 
 !! test
 Italics and bold: other quote tests: (2,(3,3),2)
 
 !! test
 Italics and bold: other quote tests: (2,(3,3),2)
-!! input
+!! wikitext
 ''this is about '''foo's''' family''
 ''this is about '''foo's''' family''
-!! result
+!! html
 <p><i>this is about <b>foo's</b> family</i>
 </p>
 !!end
 <p><i>this is about <b>foo's</b> family</i>
 </p>
 !!end
@@ -821,9 +776,9 @@ Italics and bold: other quote tests: (2,(3,3),2)
 
 !! test
 Italics and bold: other quote tests: (3,2,3,2)
 
 !! test
 Italics and bold: other quote tests: (3,2,3,2)
-!! input
+!! wikitext
 '''this is about ''foo'''s family''
 '''this is about ''foo'''s family''
-!! result
+!! html
 <p><b>this is about <i>foo</i></b><i>s family</i>
 </p>
 !!end
 <p><b>this is about <i>foo</i></b><i>s family</i>
 </p>
 !!end
@@ -832,9 +787,9 @@ Italics and bold: other quote tests: (3,2,3,2)
 !! test
 Italics and bold: other quote tests: (3,2,3,3)
 !! options
 !! test
 Italics and bold: other quote tests: (3,2,3,3)
 !! options
-!! input
+!! wikitext
 '''this is about ''foo'''s family'''
 '''this is about ''foo'''s family'''
-!! result
+!! html
 <p>'<i>this is about </i>foo<b>s family</b>
 </p>
 !!end
 <p>'<i>this is about </i>foo<b>s family</b>
 </p>
 !!end
@@ -842,9 +797,9 @@ Italics and bold: other quote tests: (3,2,3,3)
 
 !! test
 Italics and bold: other quote tests: (3,(2,2),3)
 
 !! test
 Italics and bold: other quote tests: (3,(2,2),3)
-!! input
+!! wikitext
 '''this is about ''foo's'' family'''
 '''this is about ''foo's'' family'''
-!! result
+!! html
 <p><b>this is about <i>foo's</i> family</b>
 </p>
 !!end
 <p><b>this is about <i>foo's</i> family</b>
 </p>
 !!end
@@ -852,9 +807,9 @@ Italics and bold: other quote tests: (3,(2,2),3)
 
 !! test
 Italicized possessive
 
 !! test
 Italicized possessive
-!! input
+!! wikitext
 The ''[[Main Page]]'''s talk page.
 The ''[[Main Page]]'''s talk page.
-!! result
+!! html
 <p>The <i><a href="/wiki/Main_Page" title="Main Page">Main Page</a>'</i>s talk page.
 </p>
 !! end
 <p>The <i><a href="/wiki/Main_Page" title="Main Page">Main Page</a>'</i>s talk page.
 </p>
 !! end
@@ -864,12 +819,12 @@ Parsoid only: Quote balancing context should be restricted to td/th cells on the
 (Requires tidy for PHP parser output to be fixed up)
 !! options
 parsoid=wt2html,wt2wt
 (Requires tidy for PHP parser output to be fixed up)
 !! options
 parsoid=wt2html,wt2wt
-!! input
+!! wikitext
 {|
 !''a!!''b
 |''a||''b
 |}
 {|
 !''a!!''b
 |''a||''b
 |}
-!! result
+!! html
 <table>
 <tbody><tr><th><i>a</i></th><th><i>b</i></th>
 <td><i>a</i></td><td><i>b</i></td></tr>
 <table>
 <tbody><tr><th><i>a</i></th><th><i>b</i></th>
 <td><i>a</i></td><td><i>b</i></td></tr>
@@ -882,13 +837,13 @@ parsoid=wt2html,wt2wt
 
 !! test
 Non-html5 tags should be accepted
 
 !! test
 Non-html5 tags should be accepted
-!! input
+!! wikitext
 <center>''foo''</center>
 <big>''foo''</big>
 <font>''foo''</font>
 <strike>''foo''</strike>
 <tt>''foo''</tt>
 <center>''foo''</center>
 <big>''foo''</big>
 <font>''foo''</font>
 <strike>''foo''</strike>
 <tt>''foo''</tt>
-!! result
+!! html
 <center><i>foo</i></center>
 <p><big><i>foo</i></big>
 <font><i>foo</i></font>
 <center><i>foo</i></center>
 <p><big><i>foo</i></big>
 <font><i>foo</i></font>
@@ -899,9 +854,9 @@ Non-html5 tags should be accepted
 
 !! test
 <wbr> is valid wikitext (bug 52468)
 
 !! test
 <wbr> is valid wikitext (bug 52468)
-!! input
+!! wikitext
 <wbr>
 <wbr>
-!! result
+!! html
 <p><wbr />
 </p>
 !! end
 <p><wbr />
 </p>
 !! end
@@ -909,11 +864,11 @@ Non-html5 tags should be accepted
 # <strike> is HTML4, <s> is HTML4/5.
 !! test
 <s> or <strike> for strikethrough
 # <strike> is HTML4, <s> is HTML4/5.
 !! test
 <s> or <strike> for strikethrough
-!! input
+!! wikitext
 <strike>strike</strike>
 
 <s>s</s>
 <strike>strike</strike>
 
 <s>s</s>
-!! result
+!! html
 <p><strike>strike</strike>
 </p><p><s>s</s>
 </p>
 <p><strike>strike</strike>
 </p><p><s>s</s>
 </p>
@@ -921,7 +876,7 @@ Non-html5 tags should be accepted
 
 !! test
 Non-word characters don't terminate tag names (bug 17663, 40670, 52022)
 
 !! test
 Non-word characters don't terminate tag names (bug 17663, 40670, 52022)
-!! input
+!! wikitext
 <b→> doesn't work! </b→>
 
 <bä> doesn't work! </bä>
 <b→> doesn't work! </b→>
 
 <bä> doesn't work! </bä>
@@ -931,7 +886,7 @@ Non-word characters don't terminate tag names (bug 17663, 40670, 52022)
 <s.foo>s.foo</s.foo>
 
 <sub-ID#1>
 <s.foo>s.foo</s.foo>
 
 <sub-ID#1>
-!! result
+!! html
 <p>&lt;b→&gt; doesn't work! &lt;/b→&gt;
 </p><p>&lt;bä&gt; doesn't work! &lt;/bä&gt;
 </p><p>&lt;boo&gt; works fine &lt;/boo&gt;
 <p>&lt;b→&gt; doesn't work! &lt;/b→&gt;
 </p><p>&lt;bä&gt; doesn't work! &lt;/bä&gt;
 </p><p>&lt;boo&gt; works fine &lt;/boo&gt;
@@ -942,11 +897,11 @@ Non-word characters don't terminate tag names (bug 17663, 40670, 52022)
 
 !! test
 Isolated close tags should be treated as literal text (bug 52760)
 
 !! test
 Isolated close tags should be treated as literal text (bug 52760)
-!! input
+!! wikitext
 </b>
 
 <s.foo>s</s>
 </b>
 
 <s.foo>s</s>
-!! result
+!! html
 <p>&lt;/b&gt;
 </p><p>&lt;s.foo&gt;s&lt;/s&gt;
 </p>
 <p>&lt;/b&gt;
 </p><p>&lt;s.foo&gt;s&lt;/s&gt;
 </p>
@@ -958,18 +913,18 @@ Isolated close tags should be treated as literal text (bug 52760)
 
 !! test
 Bare pipe character (bug 52363)
 
 !! test
 Bare pipe character (bug 52363)
-!! input
+!! wikitext
 |
 |
-!! result
+!! html
 <p>|
 </p>
 !! end
 
 !! test
 Bare pipe character from a template (bug 52363)
 <p>|
 </p>
 !! end
 
 !! test
 Bare pipe character from a template (bug 52363)
-!! input
+!! wikitext
 {{pipe}}
 {{pipe}}
-!! result
+!! html
 <p>|
 </p>
 !! end
 <p>|
 </p>
 !! end
@@ -980,16 +935,16 @@ Bare pipe character from a template (bug 52363)
 
 !! test
 <nowiki> unordered list
 
 !! test
 <nowiki> unordered list
-!! input
+!! wikitext
 <nowiki>* This is not an unordered list item.</nowiki>
 <nowiki>* This is not an unordered list item.</nowiki>
-!! result
+!! html
 <p>* This is not an unordered list item.
 </p>
 !! end
 
 !! test
 <nowiki> spacing
 <p>* This is not an unordered list item.
 </p>
 !! end
 
 !! test
 <nowiki> spacing
-!! input
+!! wikitext
 <nowiki>Lorem ipsum dolor
 
 sed abit.
 <nowiki>Lorem ipsum dolor
 
 sed abit.
@@ -997,7 +952,7 @@ sed abit.
 
 :and a colon
 </nowiki>
 
 :and a colon
 </nowiki>
-!! result
+!! html
 <p>Lorem ipsum dolor
 
 sed abit.
 <p>Lorem ipsum dolor
 
 sed abit.
@@ -1010,7 +965,7 @@ sed abit.
 
 !! test
 nowiki 3
 
 !! test
 nowiki 3
-!! input
+!! wikitext
 :There is not nowiki.
 :There is <nowiki>nowiki</nowiki>.
 
 :There is not nowiki.
 :There is <nowiki>nowiki</nowiki>.
 
@@ -1019,7 +974,7 @@ nowiki 3
 
 *There is not nowiki.
 *There is <nowiki>nowiki</nowiki>.
 
 *There is not nowiki.
 *There is <nowiki>nowiki</nowiki>.
-!! result
+!! html
 <dl>
 <dd>There is not nowiki.
 </dd>
 <dl>
 <dd>There is not nowiki.
 </dd>
@@ -1043,9 +998,9 @@ nowiki 3
 
 !! test
 Entities inside <nowiki>
 
 !! test
 Entities inside <nowiki>
-!! input
+!! wikitext
 <nowiki>&lt;</nowiki>
 <nowiki>&lt;</nowiki>
-!! result
+!! html
 <p>&lt;
 </p>
 !! end
 <p>&lt;
 </p>
 !! end
@@ -1054,9 +1009,9 @@ Entities inside <nowiki>
 Entities inside template parameters
 !! options
 parsoid
 Entities inside template parameters
 !! options
 parsoid
-!! input
+!! wikitext
 {{echo|&ndash;}}
 {{echo|&ndash;}}
-!! result
+!! html
 <p><span typeof="mw:Transclusion mw:Entity" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&amp;ndash;"}},"i":0}}]}'>&ndash;</span>
 </p>
 !! end
 <p><span typeof="mw:Transclusion mw:Entity" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&amp;ndash;"}},"i":0}}]}'>&ndash;</span>
 </p>
 !! end
@@ -1066,7 +1021,7 @@ parsoid
 ###
 !! test
 Comments and Indent-Pre
 ###
 !! test
 Comments and Indent-Pre
-!! input
+!! wikitext
 <!-- comment 1 --> asdf
 
 <!-- comment 1 --> asdf
 <!-- comment 1 --> asdf
 
 <!-- comment 1 --> asdf
@@ -1077,7 +1032,7 @@ Comments and Indent-Pre
 
 <!-- comment 1 --> asdf
 <!-- comment 2 --> xyz
 
 <!-- comment 1 --> asdf
 <!-- comment 2 --> xyz
-!! result
+!! html
 <pre>asdf
 </pre>
 <pre>asdf
 <pre>asdf
 </pre>
 <pre>asdf
@@ -1093,11 +1048,11 @@ xyz
 
 !! test
 Comment test 2a
 
 !! test
 Comment test 2a
-!! input
+!! wikitext
 asdf
 <!-- comment 1 -->
 jkl
 asdf
 <!-- comment 1 -->
 jkl
-!! result
+!! html
 <p>asdf
 jkl
 </p>
 <p>asdf
 jkl
 </p>
@@ -1105,12 +1060,12 @@ jkl
 
 !! test
 Comment test 2b
 
 !! test
 Comment test 2b
-!! input
+!! wikitext
 asdf
 <!-- comment 1 -->
 
 jkl
 asdf
 <!-- comment 1 -->
 
 jkl
-!! result
+!! html
 <p>asdf
 </p><p>jkl
 </p>
 <p>asdf
 </p><p>jkl
 </p>
@@ -1118,12 +1073,12 @@ jkl
 
 !! test
 Comment test 3
 
 !! test
 Comment test 3
-!! input
+!! wikitext
 asdf
 <!-- comment 1 -->
 <!-- comment 2 -->
 jkl
 asdf
 <!-- comment 1 -->
 <!-- comment 2 -->
 jkl
-!! result
+!! html
 <p>asdf
 jkl
 </p>
 <p>asdf
 jkl
 </p>
@@ -1131,20 +1086,20 @@ jkl
 
 !! test
 Comment test 4
 
 !! test
 Comment test 4
-!! input
+!! wikitext
 asdf<!-- comment 1 -->jkl
 asdf<!-- comment 1 -->jkl
-!! result
+!! html
 <p>asdfjkl
 </p>
 !! end
 
 !! test
 Comment spacing
 <p>asdfjkl
 </p>
 !! end
 
 !! test
 Comment spacing
-!! input
+!! wikitext
 a
  <!-- foo --> b <!-- bar -->
 c
 a
  <!-- foo --> b <!-- bar -->
 c
-!! result
+!! html
 <p>a
 </p>
 <pre> b 
 <p>a
 </p>
 <pre> b 
 
 !! test
 Comment whitespace
 
 !! test
 Comment whitespace
-!! input
+!! wikitext
 <!-- returns a single newline, not nothing, since the newline after > is not stripped -->
 <!-- returns a single newline, not nothing, since the newline after > is not stripped -->
-!! result
+!! html
 
 !! end
 
 !! test
 Comment semantics and delimiters
 
 !! end
 
 !! test
 Comment semantics and delimiters
-!! input
+!! wikitext
 <!-- --><!----><!-----><!------>
 <!-- --><!----><!-----><!------>
-!! result
+!! html
 
 !! end
 
 !! test
 Comment semantics and delimiters, redux
 
 !! end
 
 !! test
 Comment semantics and delimiters, redux
-!! input
+!! wikitext
 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
 -- foo -- funky huh? ... -->
 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
 -- foo -- funky huh? ... -->
-!! result
+!! html
 
 !! end
 
 !! test
 Comment semantics and delimiters: directors cut
 
 !! end
 
 !! test
 Comment semantics and delimiters: directors cut
-!! input
+!! wikitext
 <!-- ... However we like to keep things simple and somewhat XML-ish so we eat
 everything starting with < followed by !-- until the first -- and > we see,
 that wouldn't be valid XML however, since in XML -- has to terminate a comment
 -->-->
 <!-- ... However we like to keep things simple and somewhat XML-ish so we eat
 everything starting with < followed by !-- until the first -- and > we see,
 that wouldn't be valid XML however, since in XML -- has to terminate a comment
 -->-->
-!! result
+!! html
 <p>--&gt;
 </p>
 !! end
 
 !! test
 Comment semantics: nesting
 <p>--&gt;
 </p>
 !! end
 
 !! test
 Comment semantics: nesting
-!! input
+!! wikitext
 <!--<!-- no, we're not going to do anything fancy here -->-->
 <!--<!-- no, we're not going to do anything fancy here -->-->
-!! result
+!! html
 <p>--&gt;
 </p>
 !! end
 
 !! test
 Comment semantics: unclosed comment at end
 <p>--&gt;
 </p>
 !! end
 
 !! test
 Comment semantics: unclosed comment at end
-!! input
+!! wikitext
 <!--This comment will run out to the end of the document
 <!--This comment will run out to the end of the document
-!! result
+!! html
 
 !! end
 
 !! test
 Comment in template title
 
 !! end
 
 !! test
 Comment in template title
-!! input
+!! wikitext
 {{f<!---->oo}}
 {{f<!---->oo}}
-!! result
+!! html
 <p>FOO
 </p>
 !! end
 
 !! test
 Comment on its own line post-expand
 <p>FOO
 </p>
 !! end
 
 !! test
 Comment on its own line post-expand
-!! input
+!! wikitext
 a
 {{blank}}<!---->
 b
 a
 {{blank}}<!---->
 b
-!! result
+!! html
 <p>a
 </p><p>b
 </p>
 <p>a
 </p><p>b
 </p>
 
 !! test
 Comment on its own line post-expand with non-significant whitespace
 
 !! test
 Comment on its own line post-expand with non-significant whitespace
-!! input
+!! wikitext
 a
  {{blank}} <!----> 
 b
 a
  {{blank}} <!----> 
 b
-!! result
+!! html
 <p>a
 </p><p>b
 </p>
 <p>a
 </p><p>b
 </p>
 ###
 !! test
 No block tags
 ###
 !! test
 No block tags
-!! input
+!! wikitext
 a
 
 b
 a
 
 b
-!! result
+!! html
 <p>a
 </p><p>b
 </p>
 <p>a
 </p><p>b
 </p>
 
 !! test
 Block tag on one line (<div>)
 
 !! test
 Block tag on one line (<div>)
-!! input
+!! wikitext
 a <div>foo</div>
 
 b
 a <div>foo</div>
 
 b
-!! result
+!! html
 a <div>foo</div>
 <p>b
 </p>
 a <div>foo</div>
 <p>b
 </p>
@@ -1269,11 +1224,11 @@ a <div>foo</div>
 
 !! test
 Block tag on one line (<blockquote>)
 
 !! test
 Block tag on one line (<blockquote>)
-!! input
+!! wikitext
 a <blockquote>foo</blockquote>
 
 b
 a <blockquote>foo</blockquote>
 
 b
-!! result
+!! html
 a <blockquote>foo</blockquote>
 <p>b
 </p>
 a <blockquote>foo</blockquote>
 <p>b
 </p>
@@ -1281,11 +1236,11 @@ a <blockquote>foo</blockquote>
 
 !! test
 Block tag on both lines (<div>)
 
 !! test
 Block tag on both lines (<div>)
-!! input
+!! wikitext
 a <div>foo</div>
 
 b <div>foo</div>
 a <div>foo</div>
 
 b <div>foo</div>
-!! result
+!! html
 a <div>foo</div>
 b <div>foo</div>
 
 a <div>foo</div>
 b <div>foo</div>
 
@@ -1293,11 +1248,11 @@ b <div>foo</div>
 
 !! test
 Block tag on both lines (<blockquote>)
 
 !! test
 Block tag on both lines (<blockquote>)
-!! input
+!! wikitext
 a <blockquote>foo</blockquote>
 
 b <blockquote>foo</blockquote>
 a <blockquote>foo</blockquote>
 
 b <blockquote>foo</blockquote>
-!! result
+!! html
 a <blockquote>foo</blockquote>
 b <blockquote>foo</blockquote>
 
 a <blockquote>foo</blockquote>
 b <blockquote>foo</blockquote>
 
@@ -1305,13 +1260,13 @@ b <blockquote>foo</blockquote>
 
 !! test
 Multiple lines without block tags
 
 !! test
 Multiple lines without block tags
-!! input
+!! wikitext
 <div>foo</div> a
 b
 c
 d<!--foo--> e
 x <div>foo</div> z
 <div>foo</div> a
 b
 c
 d<!--foo--> e
 x <div>foo</div> z
-!! result
+!! html
 <div>foo</div> a
 <p>b
 c
 <div>foo</div> a
 <p>b
 c
@@ -1323,7 +1278,7 @@ x <div>foo</div> z
 
 !! test
 Empty lines between lines with block tags
 
 !! test
 Empty lines between lines with block tags
-!! input
+!! wikitext
 <div></div>
 
 
 <div></div>
 
 
@@ -1336,7 +1291,7 @@ b
 
 
 <div>e</div>
 
 
 <div>e</div>
-!! result
+!! html
 <div></div>
 <p><br />
 </p>
 <div></div>
 <p><br />
 </p>
 ## PHP parser emits output which is broken
 !! test
 Unclosed HTML p-tags should be handled properly
 ## PHP parser emits output which is broken
 !! test
 Unclosed HTML p-tags should be handled properly
-!! options
-parsoid
-!! input
+!! wikitext
 <div><p>foo</div>
 a
 
 b
 <div><p>foo</div>
 a
 
 b
-!! result
+!! html/parsoid
 <div data-parsoid='{"stx":"html"}'><p data-parsoid='{"stx":"html", "autoInsertedEnd":true}'>foo</p></div>
 <p>a</p>
 <p>b</p>
 <div data-parsoid='{"stx":"html"}'><p data-parsoid='{"stx":"html", "autoInsertedEnd":true}'>foo</p></div>
 <p>a</p>
 <p>b</p>
 ###
 !! test
 Preformatted text
 ###
 !! test
 Preformatted text
-!! input
+!! wikitext
  This is some
  Preformatted text
  With ''italic''
  And '''bold'''
  And a [[Main Page|link]]
  This is some
  Preformatted text
  With ''italic''
  And '''bold'''
  And a [[Main Page|link]]
-!! result
+!! html
 <pre>This is some
 Preformatted text
 With <i>italic</i>
 <pre>This is some
 Preformatted text
 With <i>italic</i>
@@ -1389,12 +1342,12 @@ And a <a href="/wiki/Main_Page" title="Main Page">link</a>
 
 !! test
 Tabs don't trigger preformatted text
 
 !! test
 Tabs don't trigger preformatted text
-!! input
+!! wikitext
        This is not
         preformatted text.
  This is preformatted text.
        So is this.
        This is not
         preformatted text.
  This is preformatted text.
        So is this.
-!! result
+!! html
 <p>    This is not
         preformatted text.
 </p>
 <p>    This is not
         preformatted text.
 </p>
@@ -1405,10 +1358,10 @@ Tabs don't trigger preformatted text
 
 !! test
 Ident preformatting with inline content
 
 !! test
 Ident preformatting with inline content
-!! input
+!! wikitext
  a
  ''b''
  a
  ''b''
-!! result
+!! html
 <pre>a
 <i>b</i>
 </pre>
 <pre>a
 <i>b</i>
 </pre>
@@ -1416,13 +1369,13 @@ Ident preformatting with inline content
 
 !! test
 <pre> with <nowiki> inside (compatibility with 1.6 and earlier)
 
 !! test
 <pre> with <nowiki> inside (compatibility with 1.6 and earlier)
-!! input
+!! wikitext
 <pre><nowiki>
 <b>
 <cite>
 <em>
 </nowiki></pre>
 <pre><nowiki>
 <b>
 <cite>
 <em>
 </nowiki></pre>
-!! result
+!! html
 <pre>
 &lt;b&gt;
 &lt;cite&gt;
 <pre>
 &lt;b&gt;
 &lt;cite&gt;
@@ -1433,11 +1386,11 @@ Ident preformatting with inline content
 
 !! test
 Regression with preformatted in <center>
 
 !! test
 Regression with preformatted in <center>
-!! input
+!! wikitext
 <center>
  Blah
 </center>
 <center>
  Blah
 </center>
-!! result
+!! html
 <center>
 <pre>Blah
 </pre>
 <center>
 <pre>Blah
 </pre>
@@ -1447,7 +1400,7 @@ Regression with preformatted in <center>
 
 !! test
 Bug 52763: Preformatted in <blockquote>
 
 !! test
 Bug 52763: Preformatted in <blockquote>
-!! input
+!! wikitext
 <blockquote>
  Blah
 {|
 <blockquote>
  Blah
 {|
@@ -1455,7 +1408,7 @@ Bug 52763: Preformatted in <blockquote>
  indented cell (no pre-wrapping!)
 |}
 </blockquote>
  indented cell (no pre-wrapping!)
 |}
 </blockquote>
-!! result
+!! html
 <blockquote>
 <p> Blah
 </p>
 <blockquote>
 <p> Blah
 </p>
@@ -1471,13 +1424,13 @@ Bug 52763: Preformatted in <blockquote>
 
 !! test
 Bug 51086: Double newlines in blockquotes should be turned into paragraphs
 
 !! test
 Bug 51086: Double newlines in blockquotes should be turned into paragraphs
-!! input
+!! wikitext
 <blockquote>
 Foo
 
 Bar
 </blockquote>
 <blockquote>
 Foo
 
 Bar
 </blockquote>
-!! result
+!! html
 <blockquote>
 <p>Foo
 </p><p>Bar
 <blockquote>
 <p>Foo
 </p><p>Bar
@@ -1488,11 +1441,11 @@ Bar
 
 !! test
 Bug 15491: <ins>/<del> in blockquote
 
 !! test
 Bug 15491: <ins>/<del> in blockquote
-!! input
+!! wikitext
 <blockquote>
 Foo <del>bar</del> <ins>baz</ins> quux
 </blockquote>
 <blockquote>
 Foo <del>bar</del> <ins>baz</ins> quux
 </blockquote>
-!! result
+!! html
 <blockquote>
 <p>Foo <del>bar</del> <ins>baz</ins> quux
 </p>
 <blockquote>
 <p>Foo <del>bar</del> <ins>baz</ins> quux
 </p>
@@ -1505,10 +1458,10 @@ Foo <del>bar</del> <ins>baz</ins> quux
 # below in a <p> tag. (see comment 23-25 of bug #6200)
 !! test
 Bug 15491: <ins>/<del> in blockquote (2)
 # below in a <p> tag. (see comment 23-25 of bug #6200)
 !! test
 Bug 15491: <ins>/<del> in blockquote (2)
-!! input
+!! wikitext
 <blockquote>Foo <del>bar</del> <ins>baz</ins> quux
 </blockquote>
 <blockquote>Foo <del>bar</del> <ins>baz</ins> quux
 </blockquote>
-!! result
+!! html
 <blockquote>Foo <del>bar</del> <ins>baz</ins> quux
 </blockquote>
 
 <blockquote>Foo <del>bar</del> <ins>baz</ins> quux
 </blockquote>
 
@@ -1516,52 +1469,52 @@ Bug 15491: <ins>/<del> in blockquote (2)
 
 !! test
 <pre> with attributes (bug 3202)
 
 !! test
 <pre> with attributes (bug 3202)
-!! input
+!! wikitext
 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
-!! result
+!! html
 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
 
 !! end
 
 !! test
 <pre> with width attribute (bug 3202)
 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
 
 !! end
 
 !! test
 <pre> with width attribute (bug 3202)
-!! input
+!! wikitext
 <pre width="8">Narrow screen goodies</pre>
 <pre width="8">Narrow screen goodies</pre>
-!! result
+!! html
 <pre width="8">Narrow screen goodies</pre>
 
 !! end
 
 !! test
 <pre> with forbidden attribute (bug 3202)
 <pre width="8">Narrow screen goodies</pre>
 
 !! end
 
 !! test
 <pre> with forbidden attribute (bug 3202)
-!! input
+!! wikitext
 <pre width="8" onmouseover="alert(document.cookie)">Narrow screen goodies</pre>
 <pre width="8" onmouseover="alert(document.cookie)">Narrow screen goodies</pre>
-!! result
+!! html
 <pre width="8">Narrow screen goodies</pre>
 
 !! end
 
 !! test
 Entities inside <pre>
 <pre width="8">Narrow screen goodies</pre>
 
 !! end
 
 !! test
 Entities inside <pre>
-!! input
+!! wikitext
 <pre>&lt;</pre>
 <pre>&lt;</pre>
-!! result
+!! html
 <pre>&lt;</pre>
 
 !! end
 
 !! test
 <pre> with forbidden attribute values (bug 3202)
 <pre>&lt;</pre>
 
 !! end
 
 !! test
 <pre> with forbidden attribute values (bug 3202)
-!! input
+!! wikitext
 <pre width="8" style="border-width: expression(alert(document.cookie))">Narrow screen goodies</pre>
 <pre width="8" style="border-width: expression(alert(document.cookie))">Narrow screen goodies</pre>
-!! result
+!! html
 <pre width="8" style="/* insecure input */">Narrow screen goodies</pre>
 
 !! end
 
 !! test
 <nowiki> inside <pre> (bug 13238)
 <pre width="8" style="/* insecure input */">Narrow screen goodies</pre>
 
 !! end
 
 !! test
 <nowiki> inside <pre> (bug 13238)
-!! input
+!! wikitext
 <pre>
 <nowiki>
 </pre>
 <pre>
 <nowiki>
 </pre>
@@ -1569,7 +1522,7 @@ Entities inside <pre>
 <nowiki></nowiki>
 </pre>
 <pre><nowiki><nowiki></nowiki>Foo<nowiki></nowiki></nowiki></pre>
 <nowiki></nowiki>
 </pre>
 <pre><nowiki><nowiki></nowiki>Foo<nowiki></nowiki></nowiki></pre>
-!! result
+!! html
 <pre>
 &lt;nowiki&gt;
 </pre>
 <pre>
 &lt;nowiki&gt;
 </pre>
@@ -1582,7 +1535,7 @@ Entities inside <pre>
 
 !! test
 <nowiki> and <pre> preference (first one wins)
 
 !! test
 <nowiki> and <pre> preference (first one wins)
-!! input
+!! wikitext
 <pre>
 <nowiki>
 </pre>
 <pre>
 <nowiki>
 </pre>
@@ -1596,7 +1549,7 @@ Entities inside <pre>
 </nowiki>
 </pre>
 
 </nowiki>
 </pre>
 
-!! result
+!! html
 <pre>
 &lt;nowiki&gt;
 </pre>
 <pre>
 &lt;nowiki&gt;
 </pre>
@@ -1613,23 +1566,23 @@ Entities inside <pre>
 
 !! test
 </pre> inside nowiki
 
 !! test
 </pre> inside nowiki
-!! input
+!! wikitext
 <nowiki></pre></nowiki>
 <nowiki></pre></nowiki>
-!! result
+!! html
 <p>&lt;/pre&gt;
 </p>
 !! end
 
 !! test
 Empty pre; pre inside other HTML tags (bug 54946)
 <p>&lt;/pre&gt;
 </p>
 !! end
 
 !! test
 Empty pre; pre inside other HTML tags (bug 54946)
-!! input
+!! wikitext
 a
 
 <div><pre>
 foo
 </pre></div>
 <pre></pre>
 a
 
 <div><pre>
 foo
 </pre></div>
 <pre></pre>
-!! result
+!! html
 <p>a
 </p>
 <div><pre>
 <p>a
 </p>
 <div><pre>
@@ -1641,10 +1594,10 @@ foo
 
 !! test
 HTML pre followed by indent-pre
 
 !! test
 HTML pre followed by indent-pre
-!! input
+!! wikitext
 <pre>foo</pre>
  bar
 <pre>foo</pre>
  bar
-!! result
+!! html
 <pre>foo</pre>
 <pre>bar
 </pre>
 <pre>foo</pre>
 <pre>bar
 </pre>
@@ -1654,36 +1607,36 @@ HTML pre followed by indent-pre
 Block tag pre
 !!options
 parsoid
 Block tag pre
 !!options
 parsoid
-!!input
+!! wikitext
 <p><pre>foo</pre></p>
 <p><pre>foo</pre></p>
-!!result
-<p data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[0,3,3,0]}'></p><pre data-parsoid='{"stx":"html","dsr":[3,17,5,6]}'>foo</pre><p data-parsoid='{"autoInsertedStart":true,"stx":"html","dsr":[17,21,0,null]}'></p>
+!! html
+<p data-parsoid='{"stx":"html","autoInsertedEnd":true}'></p><pre data-parsoid='{"stx":"html"}'>foo</pre><p data-parsoid='{"autoInsertedStart":true,"stx":"html"}'></p>
 !!end
 
 !!test
 Templates: Indent-Pre: 1a. Templates that break a line should suppress <pre>
 !!end
 
 !!test
 Templates: Indent-Pre: 1a. Templates that break a line should suppress <pre>
-!!input
+!! wikitext
  {{echo|}}
  {{echo|}}
-!!result
+!! html
 
 !!end
 
 !!test
 Templates: Indent-Pre: 1b. Templates that break a line should suppress <pre>
 
 !!end
 
 !!test
 Templates: Indent-Pre: 1b. Templates that break a line should suppress <pre>
-!!input
+!! wikitext
  {{echo|
 foo}}
  {{echo|
 foo}}
-!!result
+!! html
 <p>foo
 </p>
 !!end
 
 !! test
 Templates: Indent-Pre: 1c: Wrapping should be based on expanded content
 <p>foo
 </p>
 !!end
 
 !! test
 Templates: Indent-Pre: 1c: Wrapping should be based on expanded content
-!! input
+!! wikitext
  {{echo|a
 b}}
  {{echo|a
 b}}
-!!result
+!! html
 <pre>a
 </pre>
 <p>b
 <pre>a
 </pre>
 <p>b
@@ -1692,14 +1645,14 @@ b}}
 
 !! test
 Templates: Indent-Pre: 1d: Wrapping should be based on expanded content
 
 !! test
 Templates: Indent-Pre: 1d: Wrapping should be based on expanded content
-!! input
+!! wikitext
  {{echo|a
 b
 c
  d
 e
 }}
  {{echo|a
 b
 c
  d
 e
 }}
-!!result
+!! html
 <pre>a
 </pre>
 <p>b
 <pre>a
 </pre>
 <p>b
@@ -1713,7 +1666,7 @@ c
 
 !!test
 Templates: Indent-Pre: 1e. Wrapping should be based on expanded content
 
 !!test
 Templates: Indent-Pre: 1e. Wrapping should be based on expanded content
-!!input
+!! wikitext
 {{echo| foo}}
 
 {{echo| foo}}{{echo| bar}}
 {{echo| foo}}
 
 {{echo| foo}}{{echo| bar}}
@@ -1726,7 +1679,7 @@ Templates: Indent-Pre: 1e. Wrapping should be based on expanded content
 <!--cmt-->{{echo| foo}}
 
 {{echo|{{echo| }}bar}}
 <!--cmt-->{{echo| foo}}
 
 {{echo|{{echo| }}bar}}
-!!result
+!! html
 <pre>foo
 </pre>
 <pre>foo bar
 <pre>foo
 </pre>
 <pre>foo bar
@@ -1744,7 +1697,7 @@ bar
 
 !! test
 Templates: Indent-Pre: 1f: Wrapping should be based on expanded content
 
 !! test
 Templates: Indent-Pre: 1f: Wrapping should be based on expanded content
-!! input
+!! wikitext
 {{echo| }}a
 
 {{echo|
 {{echo| }}a
 
 {{echo|
@@ -1758,7 +1711,7 @@ Templates: Indent-Pre: 1f: Wrapping should be based on expanded content
 
 {{echo|a
 }} b
 
 {{echo|a
 }} b
-!!result
+!! html
 <pre>a
 </pre>
 <p><br />
 <pre>a
 </pre>
 <p><br />
@@ -1781,9 +1734,9 @@ Templates: Indent-Pre: 1f: Wrapping should be based on expanded content
 
 !! test
 Things that look like <pre> tags aren't treated as such
 
 !! test
 Things that look like <pre> tags aren't treated as such
-!! input
+!! wikitext
 Barack Obama <President> of the United States
 Barack Obama <President> of the United States
-!! result
+!! html
 <p>Barack Obama &lt;President&gt; of the United States
 </p>
 !! end
 <p>Barack Obama &lt;President&gt; of the United States
 </p>
 !! end
@@ -1792,9 +1745,9 @@ Barack Obama <President> of the United States
 Parsoid: handle pre with space after attribute
 !! options
 parsoid=wt2html
 Parsoid: handle pre with space after attribute
 !! options
 parsoid=wt2html
-!! input
+!! wikitext
 <pre style="width:50%;" >{{echo|foo}}</pre>
 <pre style="width:50%;" >{{echo|foo}}</pre>
-!! result
+!! html
 <pre style="width:50%;">{{echo|foo}}</pre>
 !! end
 
 <pre style="width:50%;">{{echo|foo}}</pre>
 !! end
 
@@ -1803,7 +1756,7 @@ parsoid=wt2html
 Parsoid: Don't paragraph-wrap fosterable content
 !! options
 parsoid=wt2html
 Parsoid: Don't paragraph-wrap fosterable content
 !! options
 parsoid=wt2html
-!! input
+!! wikitext
 {|
 <td></td>
 <td></td>
 {|
 <td></td>
 <td></td>
@@ -1811,7 +1764,7 @@ parsoid=wt2html
 
 
 |}
 
 
 |}
-!! result
+!! html
 <table>
 
 <tbody>
 <table>
 
 <tbody>
@@ -1829,7 +1782,7 @@ parsoid=wt2html
 Parsoid: Don't paragraph-wrap fosterable content even if table syntax is unbalanced
 !! options
 parsoid=wt2html
 Parsoid: Don't paragraph-wrap fosterable content even if table syntax is unbalanced
 !! options
 parsoid=wt2html
-!! input
+!! wikitext
 {|
 <td>
 <td>
 {|
 <td>
 <td>
@@ -1838,7 +1791,7 @@ parsoid=wt2html
 
 
 |}
 
 
 |}
-!! result
+!! html
 <table>
 
 <tbody>
 <table>
 
 <tbody>
@@ -1860,7 +1813,7 @@ parsoid=wt2html
 #--------------------------------------------------------------------
 !! test
 Templates: Strip leading and trailing whitespace from named-param values
 #--------------------------------------------------------------------
 !! test
 Templates: Strip leading and trailing whitespace from named-param values
-!! input
+!! wikitext
 {{echo|1= a }}
 
 {{echo|1= {{echo|b}} }}
 {{echo|1= a }}
 
 {{echo|1= {{echo|b}} }}
@@ -1871,7 +1824,7 @@ Templates: Strip leading and trailing whitespace from named-param values
 {{echo| 1 =
 * d
 }}
 {{echo| 1 =
 * d
 }}
-!! result
+!! html
 <p>a
 </p><p>b
 </p><p>c
 <p>a
 </p><p>b
 </p><p>c
@@ -1885,7 +1838,7 @@ Templates: Strip leading and trailing whitespace from named-param values
 
 !! test
 Templates: Don't strip whitespace from positional-param values
 
 !! test
 Templates: Don't strip whitespace from positional-param values
-!! input
+!! wikitext
 {{echo|a }}
 
 {{echo|{{echo|b}} }}
 {{echo|a }}
 
 {{echo|{{echo|b}} }}
@@ -1904,7 +1857,7 @@ Templates: Don't strip whitespace from positional-param values
 
 {{echo|
  }}g
 
 {{echo|
  }}g
-!! result
+!! html
 <p>a 
 </p><p>b 
 </p>
 <p>a 
 </p><p>b 
 </p>
@@ -1932,12 +1885,12 @@ Templates: Don't strip whitespace from positional-param values
 
 !! test
 Templates: Handle empty comment-and-ws-only lines correctly
 
 !! test
 Templates: Handle empty comment-and-ws-only lines correctly
-!! input
+!! wikitext
 {{echo|foo
 <!--should be ignored-->
  <!--should be ignored as well-->
 bar}}
 {{echo|foo
 <!--should be ignored-->
  <!--should be ignored as well-->
 bar}}
-!! result
+!! html
 <p>foo
 bar
 </p>
 <p>foo
 bar
 </p>
@@ -1950,9 +1903,9 @@ bar
 Templates: Parsoid parameter escaping test 1
 !! options
 parsoid
 Templates: Parsoid parameter escaping test 1
 !! options
 parsoid
-!! input
+!! wikitext
 {{echo|[foo]|{{echo|[bar]}}}}
 {{echo|[foo]|{{echo|[bar]}}}}
-!! result
+!! html
 <p about="#mwt1" typeof="mw:Transclusion"
 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[foo]"},"2":{"wt":"{{echo|[bar]}}"}},"i":0}}]}'>[foo]</p>
 !! end
 <p about="#mwt1" typeof="mw:Transclusion"
 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[foo]"},"2":{"wt":"{{echo|[bar]}}"}},"i":0}}]}'>[foo]</p>
 !! end
@@ -1961,9 +1914,9 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
 Parsoid: Pipes in external links in template parameter
 !! options
 parsoid
 Parsoid: Pipes in external links in template parameter
 !! options
 parsoid
-!! input
+!! wikitext
 {{echo|[{{echo|http://example.com}} link]}}
 {{echo|[{{echo|http://example.com}} link]}}
-!! result
+!! html
 <p><a rel="mw:ExtLink" href="http://example.com" about="#mwt31" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[{{echo|http://example.com}} link]"}},"i":0}}]}'>link</a></p>
 !! end
 
 <p><a rel="mw:ExtLink" href="http://example.com" about="#mwt31" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[{{echo|http://example.com}} link]"}},"i":0}}]}'>link</a></p>
 !! end
 
@@ -1971,9 +1924,9 @@ parsoid
 Parsoid: pipe in transclusion parameter
 !! options
 parsoid
 Parsoid: pipe in transclusion parameter
 !! options
 parsoid
-!! input
+!! wikitext
 {{echo|http://foo.com/a&#124;b}}
 {{echo|http://foo.com/a&#124;b}}
-!! result
+!! html
 <p><a rel="mw:ExtLink" href="http://foo.com/a|b" about="#mwt1"
 typeof="mw:Transclusion"
 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"http://foo.com/a&amp;#124;b"}},"i":0}}]}'>http://foo.com/a|b</a></p>
 <p><a rel="mw:ExtLink" href="http://foo.com/a|b" about="#mwt1"
 typeof="mw:Transclusion"
 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"http://foo.com/a&amp;#124;b"}},"i":0}}]}'>http://foo.com/a|b</a></p>
@@ -1983,9 +1936,9 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
 Parsoid: Pipe in external link target and content in template parameter
 !! options
 parsoid=html2wt,wt2wt
 Parsoid: Pipe in external link target and content in template parameter
 !! options
 parsoid=html2wt,wt2wt
-!! input
+!! wikitext
 {{echo|[http://foo.com/a&#124;b a&#124;b]}}
 {{echo|[http://foo.com/a&#124;b a&#124;b]}}
-!! result
+!! html
 <p><a rel="mw:ExtLink" href="http://foo.com/a|b" about="#mwt1"
 typeof="mw:Transclusion"
 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
 <p><a rel="mw:ExtLink" href="http://foo.com/a|b" about="#mwt1"
 typeof="mw:Transclusion"
 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
@@ -1996,11 +1949,11 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
 Templates: Don't escape already nowiki-escaped text in template parameters
 !! options
 parsoid=html2wt,wt2wt
 Templates: Don't escape already nowiki-escaped text in template parameters
 !! options
 parsoid=html2wt,wt2wt
-!! input
+!! wikitext
 {{echo|foo<nowiki>|</nowiki>bar}}
 {{echo|<nowiki>&lt;div&gt;</nowiki>}}
 {{echo|<nowiki></nowiki>}}
 {{echo|foo<nowiki>|</nowiki>bar}}
 {{echo|<nowiki>&lt;div&gt;</nowiki>}}
 {{echo|<nowiki></nowiki>}}
-!! result
+!! html
 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo<nowiki>|</nowiki>bar"}},"i":0}}]}'}'>foo</span><span typeof="mw:Nowiki" about="#mwt1">|</span><span about="#mwt1">bar</span>
 <span typeof="mw:Transclusion mw:Nowiki" about="#mwt2" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<nowiki>&amp;lt;div&amp;gt;</nowiki>"}},"i":0}}]}'><span typeof="mw:Entity">&lt;</span>div<span typeof="mw:Entity">&gt;</span></span>
 <span typeof="mw:Transclusion mw:Nowiki" about="#mwt3" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<nowiki></nowiki>"}},"i":0}}]}'></span>
 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo<nowiki>|</nowiki>bar"}},"i":0}}]}'}'>foo</span><span typeof="mw:Nowiki" about="#mwt1">|</span><span about="#mwt1">bar</span>
 <span typeof="mw:Transclusion mw:Nowiki" about="#mwt2" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<nowiki>&amp;lt;div&amp;gt;</nowiki>"}},"i":0}}]}'><span typeof="mw:Entity">&lt;</span>div<span typeof="mw:Entity">&gt;</span></span>
 <span typeof="mw:Transclusion mw:Nowiki" about="#mwt3" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<nowiki></nowiki>"}},"i":0}}]}'></span>
@@ -2012,9 +1965,9 @@ parsoid=html2wt,wt2wt
 Templates: '=' char in nested transclusions should not trigger nowiki escapes or conversion to named param
 !! options
 parsoid=html2wt,wt2wt
 Templates: '=' char in nested transclusions should not trigger nowiki escapes or conversion to named param
 !! options
 parsoid=html2wt,wt2wt
-!! input
+!! wikitext
 {{echo|{{echo|1=bar}}}}
 {{echo|{{echo|1=bar}}}}
-!! result
+!! html
 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"{{echo|1=bar}}"}},"i":0}}]}'>bar</p>
 !! end
 
 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"{{echo|1=bar}}"}},"i":0}}]}'>bar</p>
 !! end
 
@@ -2023,9 +1976,9 @@ parsoid=html2wt,wt2wt
 Templates parameters with special tokenizing behavior dont get modified because of arg escaping
 !! options
 parsoid
 Templates parameters with special tokenizing behavior dont get modified because of arg escaping
 !! options
 parsoid
-!! input
+!! wikitext
 {{echo|a : b}}
 {{echo|a : b}}
-!! result
+!! html
 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a : b"}},"i":0}}]}'>a<span typeof="mw:Placeholder" data-parsoid='{"isDisplayHack":true}'> </span>: b</p>
 !! end
 
 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a : b"}},"i":0}}]}'>a<span typeof="mw:Placeholder" data-parsoid='{"isDisplayHack":true}'> </span>: b</p>
 !! end
 
@@ -2035,11 +1988,11 @@ parsoid
 
 !!test
 1a. Indent-Pre and Comments
 
 !!test
 1a. Indent-Pre and Comments
-!!input
+!! wikitext
  a
 <!--a-->
 c
  a
 <!--a-->
 c
-!!result
+!! html
 <pre>a
 </pre>
 <p>c
 <pre>a
 </pre>
 <p>c
 
 !!test
 1b. Indent-Pre and Comments
 
 !!test
 1b. Indent-Pre and Comments
-!!input
+!! wikitext
  a
  <!--a-->
 c
  a
  <!--a-->
 c
-!!result
+!! html
 <pre>a
 </pre>
 <p>c
 <pre>a
 </pre>
 <p>c
 
 !!test
 1c. Indent-Pre and Comments
 
 !!test
 1c. Indent-Pre and Comments
-!!input
+!! wikitext
 <!--a-->  a
 
  <!--a--> a
 <!--a-->  a
 
  <!--a--> a
-!!result
+!! html
 <pre> a
 </pre>
 <pre> a
 <pre> a
 </pre>
 <pre> a
 !!test
 1d. Indent-Pre and Comments
 (Pre-handler currently cannot distinguish between comment/ws order and normalizes them to [comment,ws] order)
 !!test
 1d. Indent-Pre and Comments
 (Pre-handler currently cannot distinguish between comment/ws order and normalizes them to [comment,ws] order)
-!!input
+!! wikitext
 <!--a--> a
 
  <!--b-->b
 <!--a--> a
 
  <!--b-->b
-!!result
+!! html
 <pre>a
 </pre>
 <pre>b
 <pre>a
 </pre>
 <pre>b
 
 !!test
 2a. Indent-Pre and tables
 
 !!test
 2a. Indent-Pre and tables
-!!input
+!! wikitext
  {|
  |-
  !h1!!h2
  |foo||bar
  |}
  {|
  |-
  !h1!!h2
  |foo||bar
  |}
-!!result
+!! html
 <table>
 
 <tr>
 <table>
 
 <tr>
 
 !!test
 2b. Indent-Pre and tables
 
 !!test
 2b. Indent-Pre and tables
-!!input
+!! wikitext
   {|
  |-
 |foo
 |}
   {|
  |-
 |foo
 |}
-!!result
+!! html
 <table>
 
 <tr>
 <table>
 
 <tr>
 
 !!test
 2c. Indent-Pre and tables (bug 42252)
 
 !!test
 2c. Indent-Pre and tables (bug 42252)
-!!input
+!! wikitext
 {|
  |+ foo
  !  | bar
 |}
 {|
  |+ foo
  !  | bar
 |}
-!!result
+!! html
 <table>
 <caption> foo
 </caption>
 <table>
 <caption> foo
 </caption>
 
 !!test
 3a. Indent-Pre and block tags (single-line html)
 
 !!test
 3a. Indent-Pre and block tags (single-line html)
-!!input
+!! wikitext
  a <p> foo </p>
  b <div> foo </div>
  c <blockquote> foo </blockquote>
  <span> foo </span>
  a <p> foo </p>
  b <div> foo </div>
  c <blockquote> foo </blockquote>
  <span> foo </span>
-!!result
+!! html
  a <p> foo </p>
  b <div> foo </div>
  c <blockquote> foo </blockquote>
  a <p> foo </p>
  b <div> foo </div>
  c <blockquote> foo </blockquote>
 !!end
 
 !!test
 !!end
 
 !!test
-3c. Indent-Pre and block tags (multi-line html)
-!!input
+3b. Indent-Pre and block tags (multi-line html)
+!! wikitext
  a <span>foo</span>
  b <div> foo </div>
  a <span>foo</span>
  b <div> foo </div>
-!!result
+!! html
 <pre>a <span>foo</span>
 </pre>
  b <div> foo </div>
 <pre>a <span>foo</span>
 </pre>
  b <div> foo </div>
@@ -2168,8 +2121,8 @@ c
 !!end
 
 !!test
 !!end
 
 !!test
-3b. Indent-Pre and block tags (pre-content on separate line)
-!!input
+3c. Indent-Pre and block tags (pre-content on separate line)
+!! wikitext
 <p>
  foo
 </p>
 <p>
  foo
 </p>
@@ -2200,7 +2153,7 @@ foo
   foo
 </li></ul>
 
   foo
 </li></ul>
 
-!!result
+!! html
 <p>
  foo
 </p>
 <p>
  foo
 </p>
@@ -2231,15 +2184,87 @@ foo
 
 !!end
 
 
 !!end
 
+!!test
+4. Indent-Pre and extension tags
+!! wikitext
+ a <gallery>
+File:foobar.jpg
+</gallery>
+!! html
+ a <ul class="gallery mw-gallery-traditional">
+               <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="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
+                       <div class="gallerytext">
+                       </div>
+               </div></li>
+</ul>
+
+!!end
+
+!! test
+Leading pipes outside of tables
+!! options
+parsoid
+!! wikitext
+| foo
+!! html
+<p>| foo</p>
+!! end
+
+!! test
+Leading pipes outside of tables 2
+!! options
+parsoid
+!! wikitext
+a
+| foo
+b
+!! html
+<p>a
+| foo
+b</p>
+!! end
+
+!! test
+Leading pipes outside of tables 3
+!! options
+parsoid
+!! wikitext
+a
+| class="foo bar" | baz
+b
+!! html
+<p>a
+| class="foo bar" | baz
+b</p>
+!! end
+
+!!test
+Render paragraphs when indent-pre is suppressed in blocklevels
+!! wikitext
+<blockquote>
+ foo
+
+ bar
+</blockquote>
+!! html
+<blockquote>
+<p> foo
+</p><p> bar
+</p>
+</blockquote>
+
+!!end
+
 !!test
 4. Multiple spaces at start-of-line
 !!test
 4. Multiple spaces at start-of-line
-!!input
+!! wikitext
     <p> foo </p>
     foo
        {|
 |foo
 |}
     <p> foo </p>
     foo
        {|
 |foo
 |}
-!!result
+!! html
     <p> foo </p>
 <pre>   foo
 </pre>
     <p> foo </p>
 <pre>   foo
 </pre>
@@ -2253,11 +2278,11 @@ foo
 ## NOTE: the leading white-space chars on empty line are significant
 !! test
 5a. White-space in indent-pre
 ## NOTE: the leading white-space chars on empty line are significant
 !! test
 5a. White-space in indent-pre
-!! input
+!! wikitext
  a<br />
  
  b
  a<br />
  
  b
-!! result
+!! html
 <pre>a<br />
 
 b
 <pre>a<br />
 
 b
 ## NOTE: the leading white-space chars on empty line are significant
 !! test
 5b. White-space in indent-pre
 ## NOTE: the leading white-space chars on empty line are significant
 !! test
 5b. White-space in indent-pre
-!! input
+!! wikitext
  a
  
  b
  
  
  c
  a
  
  b
  
  
  c
-!! result
+!! html
 <pre>a
 
 b
 <pre>a
 
 b
 
 !! test
 5c. White-space in indent-pre
 
 !! test
 5c. White-space in indent-pre
-!! input
+!! wikitext
  ''a''
   ''b''
    ''c''
  ''a''
   ''b''
    ''c''
-!! result
+!! html
 <pre><i>a</i>
  <i>b</i>
   <i>c</i>
 <pre><i>a</i>
  <i>b</i>
   <i>c</i>
@@ -2299,7 +2324,7 @@ c
 
 !! test
 6. Pre-blocks should extend across lines with leading WS even when there is no wrappable content
 
 !! test
 6. Pre-blocks should extend across lines with leading WS even when there is no wrappable content
-!! input
+!! wikitext
  a
  
  <!-- continue -->
  a
  
  <!-- continue -->
@@ -2308,7 +2333,7 @@ c
  c
  
 d
  c
  
 d
-!! result
+!! html
 <pre>a
 
 b
 <pre>a
 
 b
 7a. Indent-pre and category links
 !! options
 parsoid=wt2html,wt2wt
 7a. Indent-pre and category links
 !! options
 parsoid=wt2html,wt2wt
-!! input
+!! wikitext
  [[Category:foo]] <!-- No pre-wrapping -->
 {{echo| [[Category:foo]]}} <!-- No pre-wrapping -->
  [[Category:foo]] <!-- No pre-wrapping -->
 {{echo| [[Category:foo]]}} <!-- No pre-wrapping -->
-!! result
+!! html
  <link rel="mw:PageProp/Category" href="./Category:Foo"> <!-- No pre-wrapping -->
 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" [[Category:foo]]"}},"i":0}}]}'> </span>
 <link rel="mw:PageProp/Category" href="./Category:Foo" about="#mwt1"> <!-- No pre-wrapping -->
  <link rel="mw:PageProp/Category" href="./Category:Foo"> <!-- No pre-wrapping -->
 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" [[Category:foo]]"}},"i":0}}]}'> </span>
 <link rel="mw:PageProp/Category" href="./Category:Foo" about="#mwt1"> <!-- No pre-wrapping -->
@@ -2337,10 +2362,10 @@ parsoid=wt2html,wt2wt
 7b. Indent-pre and category links
 !! options
 parsoid=wt2html,wt2wt
 7b. Indent-pre and category links
 !! options
 parsoid=wt2html,wt2wt
-!! input
+!! wikitext
  [[Category:foo]] a
  [[Category:foo]] {{echo|b}}
  [[Category:foo]] a
  [[Category:foo]] {{echo|b}}
-!! result
+!! html
 <pre>
 <link rel="mw:PageProp/Category" href="./Category:Foo"> a
 
 <pre>
 <link rel="mw:PageProp/Category" href="./Category:Foo"> a
 
@@ -2353,7 +2378,7 @@ parsoid=wt2html,wt2wt
 
 !!test
 HTML-pre: 1. embedded newlines
 
 !!test
 HTML-pre: 1. embedded newlines
-!!input
+!! wikitext
 <pre>foo</pre>
 
 <pre>
 <pre>foo</pre>
 
 <pre>
@@ -2370,7 +2395,7 @@ foo
 
 foo
 </pre>
 
 foo
 </pre>
-!!result
+!! html
 <pre>foo</pre>
 <pre>
 foo
 <pre>foo</pre>
 <pre>
 foo
@@ -2389,11 +2414,11 @@ foo
 
 !!test
 HTML-pre: 2: indented text
 
 !!test
 HTML-pre: 2: indented text
-!!input
+!! wikitext
 <pre>
  foo
 </pre>
 <pre>
  foo
 </pre>
-!!result
+!! html
 <pre>
  foo
 </pre>
 <pre>
  foo
 </pre>
@@ -2402,7 +2427,7 @@ HTML-pre: 2: indented text
 
 !!test
 HTML-pre: 3: other wikitext
 
 !!test
 HTML-pre: 3: other wikitext
-!!input
+!! wikitext
 <pre>
 * foo
 # bar
 <pre>
 * foo
 # bar
@@ -2410,7 +2435,7 @@ HTML-pre: 3: other wikitext
 '' no-italic ''
 [[ NoLink ]]
 </pre>
 '' no-italic ''
 [[ NoLink ]]
 </pre>
-!!result
+!! html
 <pre>
 * foo
 # bar
 <pre>
 * foo
 # bar
@@ -2426,9 +2451,9 @@ HTML-pre: 3: other wikitext
 ###
 !! test
 Simple definition
 ###
 !! test
 Simple definition
-!! input
+!! wikitext
 ; name : Definition
 ; name : Definition
-!! result
+!! html
 <dl>
 <dt> name&#160;</dt>
 <dd> Definition
 <dl>
 <dt> name&#160;</dt>
 <dd> Definition
@@ -2439,9 +2464,9 @@ Simple definition
 
 !! test
 Definition list for indentation only
 
 !! test
 Definition list for indentation only
-!! input
+!! wikitext
 : Indented text
 : Indented text
-!! result
+!! html
 <dl>
 <dd> Indented text
 </dd>
 <dl>
 <dd> Indented text
 </dd>
@@ -2451,9 +2476,9 @@ Definition list for indentation only
 
 !! test
 Definition list with no space
 
 !! test
 Definition list with no space
-!! input
+!! wikitext
 ;name:Definition
 ;name:Definition
-!! result
+!! html
 <dl>
 <dt>name</dt>
 <dd>Definition
 <dl>
 <dt>name</dt>
 <dd>Definition
@@ -2464,9 +2489,9 @@ Definition list with no space
 
 !! test
 Definition list with URL link
 
 !! test
 Definition list with URL link
-!! input
+!! wikitext
 ; http://example.com/ : definition
 ; http://example.com/ : definition
-!! result
+!! html
 <dl>
 <dt> <a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>&#160;</dt>
 <dd> definition
 <dl>
 <dt> <a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>&#160;</dt>
 <dd> definition
@@ -2477,9 +2502,9 @@ Definition list with URL link
 
 !! test
 Definition list with bracketed URL link
 
 !! test
 Definition list with bracketed URL link
-!! input
+!! wikitext
 ;[http://www.example.com/ Example]:Something about it
 ;[http://www.example.com/ Example]:Something about it
-!! result
+!! html
 <dl>
 <dt><a rel="nofollow" class="external text" href="http://www.example.com/">Example</a></dt>
 <dd>Something about it
 <dl>
 <dt><a rel="nofollow" class="external text" href="http://www.example.com/">Example</a></dt>
 <dd>Something about it
@@ -2490,9 +2515,9 @@ Definition list with bracketed URL link
 
 !! test
 Definition list with wikilink containing colon
 
 !! test
 Definition list with wikilink containing colon
-!! input
+!! wikitext
 ; [[Help:FAQ]]: The least-read page on Wikipedia
 ; [[Help:FAQ]]: The least-read page on Wikipedia
-!! result
+!! html
 <dl>
 <dt> <a href="/index.php?title=Help:FAQ&amp;action=edit&amp;redlink=1" class="new" title="Help:FAQ (page does not exist)">Help:FAQ</a></dt>
 <dd> The least-read page on Wikipedia
 <dl>
 <dt> <a href="/index.php?title=Help:FAQ&amp;action=edit&amp;redlink=1" class="new" title="Help:FAQ (page does not exist)">Help:FAQ</a></dt>
 <dd> The least-read page on Wikipedia
@@ -2504,9 +2529,9 @@ Definition list with wikilink containing colon
 # At Brion's and JeLuF's insistence... :)
 !! test
 Definition list with news link containing colon
 # At Brion's and JeLuF's insistence... :)
 !! test
 Definition list with news link containing colon
-!! input
+!! wikitext
 ;  news:alt.wikipedia.rox: This isn't even a real newsgroup!
 ;  news:alt.wikipedia.rox: This isn't even a real newsgroup!
-!! result
+!! html
 <dl>
 <dt>  <a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a></dt>
 <dd> This isn't even a real newsgroup!
 <dl>
 <dt>  <a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a></dt>
 <dd> This isn't even a real newsgroup!
@@ -2517,9 +2542,9 @@ Definition list with news link containing colon
 
 !! test
 Malformed definition list with colon
 
 !! test
 Malformed definition list with colon
-!! input
+!! wikitext
 ;  news:alt.wikipedia.rox -- don't crash or enter an infinite loop
 ;  news:alt.wikipedia.rox -- don't crash or enter an infinite loop
-!! result
+!! html
 <dl>
 <dt>  <a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop
 </dt>
 <dl>
 <dt>  <a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop
 </dt>
@@ -2529,9 +2554,9 @@ Malformed definition list with colon
 
 !! test
 Definition lists: colon in external link text
 
 !! test
 Definition lists: colon in external link text
-!! input
+!! wikitext
 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
-!! result
+!! html
 <dl>
 <dt> <a rel="nofollow" class="external text" href="http://www.wikipedia2.org/">Wikipedia&#160;: The Next Generation</a></dt>
 <dd> OK, I made that up
 <dl>
 <dt> <a rel="nofollow" class="external text" href="http://www.wikipedia2.org/">Wikipedia&#160;: The Next Generation</a></dt>
 <dd> OK, I made that up
@@ -2542,9 +2567,9 @@ Definition lists: colon in external link text
 
 !! test
 Definition lists: colon in HTML attribute
 
 !! test
 Definition lists: colon in HTML attribute
-!! input
+!! wikitext
 ;<b style="display: inline">bold</b>
 ;<b style="display: inline">bold</b>
-!! result
+!! html
 <dl>
 <dt><b style="display: inline">bold</b>
 </dt>
 <dl>
 <dt><b style="display: inline">bold</b>
 </dt>
@@ -2554,9 +2579,9 @@ Definition lists: colon in HTML attribute
 
 !! test
 Definition lists: self-closed tag
 
 !! test
 Definition lists: self-closed tag
-!! input
+!! wikitext
 ;one<br/>two : two-line fun
 ;one<br/>two : two-line fun
-!! result
+!! html
 <dl>
 <dt>one<br />two&#160;</dt>
 <dd> two-line fun
 <dl>
 <dt>one<br />two&#160;</dt>
 <dd> two-line fun
@@ -2567,14 +2592,14 @@ Definition lists: self-closed tag
 
 !! test
 Bug 11748: Literal closing tags
 
 !! test
 Bug 11748: Literal closing tags
-!! input
+!! wikitext
 <dl>
 <dt>test 1</dt>
 <dd>test test test test test</dd>
 <dt>test 2</dt>
 <dd>test test test test test</dd>
 </dl>
 <dl>
 <dt>test 1</dt>
 <dd>test test test test test</dd>
 <dt>test 2</dt>
 <dd>test test test test test</dd>
 </dl>
-!! result
+!! html
 <dl>
 <dt>test 1</dt>
 <dd>test test test test test</dd>
 <dl>
 <dt>test 1</dt>
 <dd>test test test test test</dd>
@@ -2586,12 +2611,12 @@ Bug 11748: Literal closing tags
 
 !! test
 Definition and unordered list using wiki syntax nested in unordered list using html tags.
 
 !! test
 Definition and unordered list using wiki syntax nested in unordered list using html tags.
-!! input
+!! wikitext
 <ul><li>
 ; term : description
 * unordered
 </li></ul>
 <ul><li>
 ; term : description
 * unordered
 </li></ul>
-!! result
+!! html
 <ul><li>
 <dl>
 <dt> term&#160;</dt>
 <ul><li>
 <dl>
 <dt> term&#160;</dt>
@@ -2609,10 +2634,10 @@ Definition and unordered list using wiki syntax nested in unordered list using h
 !! test
 
 Definition list with empty definition and following paragraph
 !! test
 
 Definition list with empty definition and following paragraph
-!! input
+!! wikitext
 ; term:
 Paragraph text
 ; term:
 Paragraph text
-!! result
+!! html
 <dl>
 <dt> term</dt>
 <dd>
 <dl>
 <dt> term</dt>
 <dd>
@@ -2624,13 +2649,13 @@ Paragraph text
 
 !! test
 Nested definition lists using html syntax
 
 !! test
 Nested definition lists using html syntax
-!! input
+!! wikitext
 <dl><dd>
 <dl>
 <dd>Foo</dd>
 </dl>
 </dd></dl>
 <dl><dd>
 <dl>
 <dd>Foo</dd>
 </dl>
 </dd></dl>
-!! result
+!! html
 <dl><dd>
 <dl>
 <dd>Foo</dd>
 <dl><dd>
 <dl>
 <dd>Foo</dd>
@@ -2641,11 +2666,11 @@ Nested definition lists using html syntax
 
 !! test
 Definition Lists: No nesting: Multiple dd's
 
 !! test
 Definition Lists: No nesting: Multiple dd's
-!! input
+!! wikitext
 ;x
 :a
 :b
 ;x
 :a
 :b
-!! result
+!! html
 <dl>
 <dt>x
 </dt>
 <dl>
 <dt>x
 </dt>
@@ -2659,11 +2684,11 @@ Definition Lists: No nesting: Multiple dd's
 
 !! test
 Definition Lists: Indentation: Regular
 
 !! test
 Definition Lists: Indentation: Regular
-!! input
+!! wikitext
 :i1
 ::i2
 :::i3
 :i1
 ::i2
 :::i3
-!! result
+!! html
 <dl>
 <dd>i1
 <dl>
 <dl>
 <dd>i1
 <dl>
@@ -2681,10 +2706,10 @@ Definition Lists: Indentation: Regular
 
 !! test
 Definition Lists: Indentation: Missing 1st level
 
 !! test
 Definition Lists: Indentation: Missing 1st level
-!! input
+!! wikitext
 ::i2
 :::i3
 ::i2
 :::i3
-!! result
+!! html
 <dl>
 <dd><dl>
 <dd>i2
 <dl>
 <dd><dl>
 <dd>i2
@@ -2701,9 +2726,9 @@ Definition Lists: Indentation: Missing 1st level
 
 !! test
 Definition Lists: Indentation: Multi-level indent
 
 !! test
 Definition Lists: Indentation: Multi-level indent
-!! input
+!! wikitext
 :::i3
 :::i3
-!! result
+!! html
 <dl>
 <dd><dl>
 <dd><dl>
 <dl>
 <dd><dl>
 <dd><dl>
@@ -2719,14 +2744,14 @@ Definition Lists: Indentation: Multi-level indent
 
 !! test
 Definition Lists: Hacky use to indent tables
 
 !! test
 Definition Lists: Hacky use to indent tables
-!! input
+!! wikitext
 ::{|
 |foo
 |bar
 |}
 this text
 should be left alone
 ::{|
 |foo
 |bar
 |}
 this text
 should be left alone
-!! result
+!! html
 <dl><dd><dl><dd><table>
 <tr>
 <td>foo
 <dl><dd><dl><dd><table>
 <tr>
 <td>foo
@@ -2743,11 +2768,11 @@ should be left alone
 Definition Lists: Hacky use to indent tables (WS-insensitive)
 !! options
 parsoid
 Definition Lists: Hacky use to indent tables (WS-insensitive)
 !! options
 parsoid
-!! input
+!! wikitext
 : {|
 |a
 |} 
 : {|
 |a
 |} 
-!! result
+!! html
 <dl>
 <dd> <table><tr><td>a</td></tr></table> </dd>
 </dl>
 <dl>
 <dd> <table><tr><td>a</td></tr></table> </dd>
 </dl>
@@ -2789,7 +2814,7 @@ parsoid
 
 !! test
 Table / list interaction: indented table with lists in table contents
 
 !! test
 Table / list interaction: indented table with lists in table contents
-!! input
+!! wikitext
 :{|
 |-
 | a
 :{|
 |-
 | a
@@ -2798,7 +2823,7 @@ Table / list interaction: indented table with lists in table contents
 | c
 * d
 |}
 | c
 * d
 |}
-!! result
+!! html
 <dl><dd><table>
 
 <tr>
 <dl><dd><table>
 
 <tr>
@@ -2820,7 +2845,7 @@ Table / list interaction: indented table with lists in table contents
 
 !!test
 Table / list interaction: lists nested in tables nested in indented lists
 
 !!test
 Table / list interaction: lists nested in tables nested in indented lists
-!!input
+!! wikitext
 :{|
 |
 :a
 :{|
 |
 :a
@@ -2832,7 +2857,7 @@ Table / list interaction: lists nested in tables nested in indented lists
 
 *e
 *f
 
 *e
 *f
-!!result
+!! html
 <dl><dd><table>
 <tr>
 <td>
 <dl><dd><table>
 <tr>
 <td>
@@ -2864,11 +2889,11 @@ Table / list interaction: lists nested in tables nested in indented lists
 Definition Lists: Nesting: Multi-level (Parsoid only)
 !! options
 parsoid
 Definition Lists: Nesting: Multi-level (Parsoid only)
 !! options
 parsoid
-!! input
+!! wikitext
 ;t1 :d1
 ;;t2 ::d2
 ;;;t3 :::d3
 ;t1 :d1
 ;;t2 ::d2
 ;;;t3 :::d3
-!! result
+!! html
 <dl>
   <dt>t1 </dt>
   <dd>d1</dd>
 <dl>
   <dt>t1 </dt>
   <dd>d1</dd>
@@ -2894,10 +2919,10 @@ parsoid
 Definition Lists: Nesting: Test 2 (Parsoid only)
 !! options
 parsoid
 Definition Lists: Nesting: Test 2 (Parsoid only)
 !! options
 parsoid
-!! input
+!! wikitext
 ;t1
 ::d2
 ;t1
 ::d2
-!! result
+!! html
 <dl>
   <dt>t1</dt>
   <dd>
 <dl>
   <dt>t1</dt>
   <dd>
@@ -2914,10 +2939,10 @@ parsoid
 Definition Lists: Nesting: Test 3 (Parsoid only)
 !! options
 parsoid
 Definition Lists: Nesting: Test 3 (Parsoid only)
 !! options
 parsoid
-!! input
+!! wikitext
 :;t1
 ::::d2
 :;t1
 ::::d2
-!! result
+!! html
 <dl>
   <dd>
     <dl>
 <dl>
   <dd>
     <dl>
@@ -2940,10 +2965,10 @@ parsoid
 
 !! test
 Definition Lists: Nesting: Test 4
 
 !! test
 Definition Lists: Nesting: Test 4
-!! input
+!! wikitext
 ::;t3
 :::d3
 ::;t3
 :::d3
-!! result
+!! html
 <dl>
 <dd><dl>
 <dd><dl>
 <dl>
 <dd><dl>
 <dd><dl>
@@ -2964,14 +2989,12 @@ Definition Lists: Nesting: Test 4
 ## bug in the PHP parser.  (Parsoid team thinks the PHP parser is
 ## wrong to close the <dl> after the <dt> containing the <ul>.)
 !! test
 ## bug in the PHP parser.  (Parsoid team thinks the PHP parser is
 ## wrong to close the <dl> after the <dt> containing the <ul>.)
 !! test
-Definition Lists: Mixed Lists: Test 1 (php)
-!! options
-php
-!! input
+Definition Lists: Mixed Lists: Test 1
+!! wikitext
 :;* foo
 ::* bar
 :; baz
 :;* foo
 ::* bar
 :; baz
-!! result
+!! html/php
 <dl>
 <dd><dl>
 <dt><ul>
 <dl>
 <dd><dl>
 <dt><ul>
@@ -2989,16 +3012,7 @@ php
 </dd>
 </dl>
 
 </dd>
 </dl>
 
-!! end
-!! test
-Definition Lists: Mixed Lists: Test 1 (parsoid)
-!! options
-parsoid
-!! input
-:;* foo
-::* bar
-:; baz
-!! result
+!! html/parsoid
 <dl>
 <dd><dl>
 <dt><ul>
 <dl>
 <dd><dl>
 <dt><ul>
@@ -3016,10 +3030,10 @@ parsoid
 
 !! test
 Definition Lists: Mixed Lists: Test 2
 
 !! test
 Definition Lists: Mixed Lists: Test 2
-!! input
+!! wikitext
 *: d1
 *: d2
 *: d1
 *: d2
-!! result
+!! html
 <ul>
 <li><dl>
 <dd> d1
 <ul>
 <li><dl>
 <dd> d1
@@ -3035,10 +3049,10 @@ Definition Lists: Mixed Lists: Test 2
 
 !! test
 Definition Lists: Mixed Lists: Test 3
 
 !! test
 Definition Lists: Mixed Lists: Test 3
-!! input
+!! wikitext
 *::: d1
 *::: d2
 *::: d1
 *::: d2
-!! result
+!! html
 <ul>
 <li><dl>
 <dd><dl>
 <ul>
 <li><dl>
 <dd><dl>
@@ -3060,10 +3074,10 @@ Definition Lists: Mixed Lists: Test 3
 
 !! test
 Definition Lists: Mixed Lists: Test 4
 
 !! test
 Definition Lists: Mixed Lists: Test 4
-!! input
+!! wikitext
 *;d1 :d2
 *;d3 :d4
 *;d1 :d2
 *;d3 :d4
-!! result
+!! html
 <ul>
 <li><dl>
 <dt>d1&#160;</dt>
 <ul>
 <li><dl>
 <dt>d1&#160;</dt>
@@ -3081,10 +3095,10 @@ Definition Lists: Mixed Lists: Test 4
 
 !! test
 Definition Lists: Mixed Lists: Test 5
 
 !! test
 Definition Lists: Mixed Lists: Test 5
-!! input
+!! wikitext
 *:d1
 *:: d2
 *:d1
 *:: d2
-!! result
+!! html
 <ul>
 <li><dl>
 <dd>d1
 <ul>
 <li><dl>
 <dd>d1
@@ -3102,10 +3116,10 @@ Definition Lists: Mixed Lists: Test 5
 
 !! test
 Definition Lists: Mixed Lists: Test 6
 
 !! test
 Definition Lists: Mixed Lists: Test 6
-!! input
+!! wikitext
 #*:d1
 #*::: d3
 #*:d1
 #*::: d3
-!! result
+!! html
 <ol>
 <li><ul>
 <li><dl>
 <ol>
 <li><ul>
 <li><dl>
@@ -3129,10 +3143,10 @@ Definition Lists: Mixed Lists: Test 6
 
 !! test
 Definition Lists: Mixed Lists: Test 7
 
 !! test
 Definition Lists: Mixed Lists: Test 7
-!! input
+!! wikitext
 :* d1
 :* d2
 :* d1
 :* d2
-!! result
+!! html
 <dl>
 <dd><ul>
 <li> d1
 <dl>
 <dd><ul>
 <li> d1
@@ -3148,10 +3162,10 @@ Definition Lists: Mixed Lists: Test 7
 
 !! test
 Definition Lists: Mixed Lists: Test 8
 
 !! test
 Definition Lists: Mixed Lists: Test 8
-!! input
+!! wikitext
 :* d1
 ::* d2
 :* d1
 ::* d2
-!! result
+!! html
 <dl>
 <dd><ul>
 <li> d1
 <dl>
 <dd><ul>
 <li> d1
@@ -3172,9 +3186,9 @@ Definition Lists: Mixed Lists: Test 8
 
 !! test
 Definition Lists: Mixed Lists: Test 9
 
 !! test
 Definition Lists: Mixed Lists: Test 9
-!! input
+!! wikitext
 *;foo :bar
 *;foo :bar
-!! result
+!! html
 <ul>
 <li><dl>
 <dt>foo&#160;</dt>
 <ul>
 <li><dl>
 <dt>foo&#160;</dt>
@@ -3189,9 +3203,9 @@ Definition Lists: Mixed Lists: Test 9
 
 !! test
 Definition Lists: Mixed Lists: Test 10
 
 !! test
 Definition Lists: Mixed Lists: Test 10
-!! input
+!! wikitext
 *#;foo :bar
 *#;foo :bar
-!! result
+!! html
 <ul>
 <li><ol>
 <li><dl>
 <ul>
 <li><ol>
 <li><dl>
@@ -3212,13 +3226,11 @@ Definition Lists: Mixed Lists: Test 10
 # still-open tags around until the nesting is complete.
 
 !! test
 # still-open tags around until the nesting is complete.
 
 !! test
-Definition Lists: Mixed Lists: Test 11 (php)
-!! options
-php
-!! input
+Definition Lists: Mixed Lists: Test 11
+!! wikitext
 *#*#;*;;foo :bar
 *#*#;boo :baz
 *#*#;*;;foo :bar
 *#*#;boo :baz
-!! result
+!! html/php
 <ul>
 <li><ol>
 <li><ul>
 <ul>
 <li><ol>
 <li><ul>
@@ -3251,15 +3263,7 @@ php
 </li>
 </ul>
 
 </li>
 </ul>
 
-!! end
-!! test
-Definition Lists: Mixed Lists: Test 11 (parsoid)
-!! options
-parsoid
-!! input
-*#*#;*;;foo :bar
-*#*#;boo :baz
-!! result
+!! html/parsoid
 <ul>
 <li>
 <ol>
 <ul>
 <li>
 <ol>
@@ -3291,12 +3295,10 @@ parsoid
 
 
 !! test
 
 
 !! test
-Definition Lists: Weird Ones: Test 1 (php)
-!! options
-php
-!! input
+Definition Lists: Weird Ones: Test 1
+!! wikitext
 *#;*::;; foo : bar (who uses this?)
 *#;*::;; foo : bar (who uses this?)
-!! result
+!! html/php
 <ul>
 <li><ol>
 <li><dl>
 <ul>
 <li><ol>
 <li><dl>
@@ -3324,14 +3326,7 @@ php
 </li>
 </ul>
 
 </li>
 </ul>
 
-!! end
-!! test
-Definition Lists: Weird Ones: Test 1 (parsoid)
-!! options
-parsoid
-!! input
-*#;*::;; foo : bar (who uses this?)
-!! result
+!! html/parsoid
 <ul>
 <li>
 <ol>
 <ul>
 <li>
 <ol>
@@ -3364,20 +3359,20 @@ parsoid
 ###
 !! test
 External links: non-bracketed
 ###
 !! test
 External links: non-bracketed
-!! input
+!! wikitext
 Non-bracketed: http://example.com
 Non-bracketed: http://example.com
-!! result
+!! html
 <p>Non-bracketed: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
 </p>
 !! end
 
 !! test
 External links: numbered
 <p>Non-bracketed: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
 </p>
 !! end
 
 !! test
 External links: numbered
-!! input
+!! wikitext
 Numbered: [http://example.com]
 Numbered: [http://example.net]
 Numbered: [http://example.com]
 Numbered: [http://example.com]
 Numbered: [http://example.net]
 Numbered: [http://example.com]
-!! result
+!! html
 <p>Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[1]</a>
 Numbered: <a rel="nofollow" class="external autonumber" href="http://example.net">[2]</a>
 Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[3]</a>
 <p>Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[1]</a>
 Numbered: <a rel="nofollow" class="external autonumber" href="http://example.net">[2]</a>
 Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[3]</a>
@@ -3386,73 +3381,73 @@ Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com
 
 !! test
 External links: specified text
 
 !! test
 External links: specified text
-!! input
+!! wikitext
 Specified text: [http://example.com link]
 Specified text: [http://example.com link]
-!! result
+!! html
 <p>Specified text: <a rel="nofollow" class="external text" href="http://example.com">link</a>
 </p>
 !!end
 
 !! test
 External links: trail
 <p>Specified text: <a rel="nofollow" class="external text" href="http://example.com">link</a>
 </p>
 !!end
 
 !! test
 External links: trail
-!! input
+!! wikitext
 Linktrails should not work for external links: [http://example.com link]s
 Linktrails should not work for external links: [http://example.com link]s
-!! result
+!! html
 <p>Linktrails should not work for external links: <a rel="nofollow" class="external text" href="http://example.com">link</a>s
 </p>
 !! end
 
 !! test
 External links: dollar sign in URL
 <p>Linktrails should not work for external links: <a rel="nofollow" class="external text" href="http://example.com">link</a>s
 </p>
 !! end
 
 !! test
 External links: dollar sign in URL
-!! input
+!! wikitext
 http://example.com/1$2345
 http://example.com/1$2345
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://example.com/1$2345">http://example.com/1$2345</a>
 </p>
 !! end
 
 !! test
 External links: dollar sign in URL (named)
 <p><a rel="nofollow" class="external free" href="http://example.com/1$2345">http://example.com/1$2345</a>
 </p>
 !! end
 
 !! test
 External links: dollar sign in URL (named)
-!! input
+!! wikitext
 [http://example.com/1$2345]
 [http://example.com/1$2345]
-!! result
+!! html
 <p><a rel="nofollow" class="external autonumber" href="http://example.com/1$2345">[1]</a>
 </p>
 !!end
 
 !! test
 External links: open square bracket forbidden in URL (bug 4377)
 <p><a rel="nofollow" class="external autonumber" href="http://example.com/1$2345">[1]</a>
 </p>
 !!end
 
 !! test
 External links: open square bracket forbidden in URL (bug 4377)
-!! input
+!! wikitext
 http://example.com/1[2345
 http://example.com/1[2345
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://example.com/1">http://example.com/1</a>[2345
 </p>
 !! end
 
 !! test
 External links: open square bracket forbidden in URL (named) (bug 4377)
 <p><a rel="nofollow" class="external free" href="http://example.com/1">http://example.com/1</a>[2345
 </p>
 !! end
 
 !! test
 External links: open square bracket forbidden in URL (named) (bug 4377)
-!! input
+!! wikitext
 [http://example.com/1[2345]
 [http://example.com/1[2345]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://example.com/1">[2345</a>
 </p>
 !!end
 
 !! test
 External links: nowiki in URL link text (bug 6230)
 <p><a rel="nofollow" class="external text" href="http://example.com/1">[2345</a>
 </p>
 !!end
 
 !! test
 External links: nowiki in URL link text (bug 6230)
-!!input
+!! wikitext
 [http://example.com/ <nowiki>''example site''</nowiki>]
 [http://example.com/ <nowiki>''example site''</nowiki>]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://example.com/">''example site''</a>
 </p>
 !! end
 
 !! test
 External links: newline forbidden in text (bug 6230 regression check)
 <p><a rel="nofollow" class="external text" href="http://example.com/">''example site''</a>
 </p>
 !! end
 
 !! test
 External links: newline forbidden in text (bug 6230 regression check)
-!! input
+!! wikitext
 [http://example.com/ first
 second]
 [http://example.com/ first
 second]
-!! result
+!! html
 <p>[<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a> first
 second]
 </p>
 <p>[<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a> first
 second]
 </p>
@@ -3460,63 +3455,63 @@ second]
 
 !! test
 External links: Pipe char between url and text
 
 !! test
 External links: Pipe char between url and text
-!! input
+!! wikitext
 [http://example.com | link]
 [http://example.com | link]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://example.com">| link</a>
 </p>
 !!end
 
 !! test
 External links: protocol-relative URL in brackets
 <p><a rel="nofollow" class="external text" href="http://example.com">| link</a>
 </p>
 !!end
 
 !! test
 External links: protocol-relative URL in brackets
-!! input
+!! wikitext
 [//example.com/ Test]
 [//example.com/ Test]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="//example.com/">Test</a>
 </p>
 !! end
 
 !! test
 External links: protocol-relative URL in brackets without text
 <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
+!! wikitext
 [//example.com]
 [//example.com]
-!! result
+!! html
 <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
 <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
+!! wikitext
 //example.com/Foo
 //example.com/Foo
-!! result
+!! html
 <p>//example.com/Foo
 </p>
 !!end
 
 !! test
 External links: protocol-relative URL in the middle of a word is left alone (bug 30269)
 <p>//example.com/Foo
 </p>
 !!end
 
 !! test
 External links: protocol-relative URL in the middle of a word is left alone (bug 30269)
-!! input
+!! wikitext
 foo//example.com/Foo
 foo//example.com/Foo
-!! result
+!! html
 <p>foo//example.com/Foo
 </p>
 !! end
 
 !! test
 External image
 <p>foo//example.com/Foo
 </p>
 !! end
 
 !! test
 External image
-!! input
+!! wikitext
 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
-!! result
+!! html
 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
 </p>
 !! end
 
 !! test
 External image from https
 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
 </p>
 !! end
 
 !! test
 External image from https
-!! input
+!! wikitext
 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
-!! result
+!! html
 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
 </p>
 !! end
 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
 </p>
 !! end
@@ -3525,135 +3520,135 @@ External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
 External image (when not allowed)
 !! options
 wgAllowExternalImages=0
 External image (when not allowed)
 !! options
 wgAllowExternalImages=0
-!! input
+!! wikitext
 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
-!! result
+!! html
 <p>External image: <a rel="nofollow" class="external free" href="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png">http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png</a>
 </p>
 !! end
 
 !! test
 Link to non-http image, no img tag
 <p>External image: <a rel="nofollow" class="external free" href="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png">http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png</a>
 </p>
 !! end
 
 !! test
 Link to non-http image, no img tag
-!! input
+!! wikitext
 Link to non-http image, no img tag: ftp://example.com/test.jpg
 Link to non-http image, no img tag: ftp://example.com/test.jpg
-!! result
+!! html
 <p>Link to non-http image, no img tag: <a rel="nofollow" class="external free" href="ftp://example.com/test.jpg">ftp://example.com/test.jpg</a>
 </p>
 !! end
 
 !! test
 External links: terminating separator
 <p>Link to non-http image, no img tag: <a rel="nofollow" class="external free" href="ftp://example.com/test.jpg">ftp://example.com/test.jpg</a>
 </p>
 !! end
 
 !! test
 External links: terminating separator
-!! input
+!! wikitext
 Terminating separator: http://example.com/thing,
 Terminating separator: http://example.com/thing,
-!! result
+!! html
 <p>Terminating separator: <a rel="nofollow" class="external free" href="http://example.com/thing">http://example.com/thing</a>,
 </p>
 !! end
 
 !! test
 External links: intervening separator
 <p>Terminating separator: <a rel="nofollow" class="external free" href="http://example.com/thing">http://example.com/thing</a>,
 </p>
 !! end
 
 !! test
 External links: intervening separator
-!! input
+!! wikitext
 Intervening separator: http://example.com/1,2,3
 Intervening separator: http://example.com/1,2,3
-!! result
+!! html
 <p>Intervening separator: <a rel="nofollow" class="external free" href="http://example.com/1,2,3">http://example.com/1,2,3</a>
 </p>
 !! end
 
 !! test
 External links: old bug with URL in query
 <p>Intervening separator: <a rel="nofollow" class="external free" href="http://example.com/1,2,3">http://example.com/1,2,3</a>
 </p>
 !! end
 
 !! test
 External links: old bug with URL in query
-!! input
+!! wikitext
 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
-!! result
+!! html
 <p>Old bug with URL in query: <a rel="nofollow" class="external text" href="http://example.com/thing?url=http://example.com">link</a>
 </p>
 !! end
 
 !! test
 External links: old URL-in-URL bug, mixed protocols
 <p>Old bug with URL in query: <a rel="nofollow" class="external text" href="http://example.com/thing?url=http://example.com">link</a>
 </p>
 !! end
 
 !! test
 External links: old URL-in-URL bug, mixed protocols
-!! input
+!! wikitext
 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
-!! result
+!! html
 <p>And again with mixed protocols: <a rel="nofollow" class="external text" href="ftp://example.com?url=http://example.com">link</a>
 </p>
 !!end
 
 !! test
 External links: URL in text
 <p>And again with mixed protocols: <a rel="nofollow" class="external text" href="ftp://example.com?url=http://example.com">link</a>
 </p>
 !!end
 
 !! test
 External links: URL in text
-!! input
+!! wikitext
 URL in text: [http://example.com http://example.com]
 URL in text: [http://example.com http://example.com]
-!! result
+!! html
 <p>URL in text: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
 </p>
 !! end
 
 !! test
 External links: Clickable images
 <p>URL in text: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
 </p>
 !! end
 
 !! test
 External links: Clickable images
-!! input
+!! wikitext
 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
-!! result
+!! html
 <p>ja-style clickable images: <a rel="nofollow" class="external text" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a>
 </p>
 !!end
 
 !! test
 External links: raw ampersand
 <p>ja-style clickable images: <a rel="nofollow" class="external text" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a>
 </p>
 !!end
 
 !! test
 External links: raw ampersand
-!! input
+!! wikitext
 Old &amp; use: http://x&y
 Old &amp; use: http://x&y
-!! result
+!! html
 <p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
 </p>
 !! end
 
 !! test
 External links: encoded ampersand
 <p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
 </p>
 !! end
 
 !! test
 External links: encoded ampersand
-!! input
+!! wikitext
 Old &amp; use: http://x&amp;y
 Old &amp; use: http://x&amp;y
-!! result
+!! html
 <p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
 </p>
 !! end
 
 !! test
 External links: encoded equals (bug 6102)
 <p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
 </p>
 !! end
 
 !! test
 External links: encoded equals (bug 6102)
-!! input
+!! wikitext
 http://example.com/?foo&#61;bar
 http://example.com/?foo&#61;bar
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://example.com/?foo=bar">http://example.com/?foo=bar</a>
 </p>
 !! end
 
 !! test
 External links: [raw ampersand]
 <p><a rel="nofollow" class="external free" href="http://example.com/?foo=bar">http://example.com/?foo=bar</a>
 </p>
 !! end
 
 !! test
 External links: [raw ampersand]
-!! input
+!! wikitext
 Old &amp; use: [http://x&y]
 Old &amp; use: [http://x&y]
-!! result
+!! html
 <p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
 </p>
 !! end
 
 !! test
 External links: [encoded ampersand]
 <p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
 </p>
 !! end
 
 !! test
 External links: [encoded ampersand]
-!! input
+!! wikitext
 Old &amp; use: [http://x&amp;y]
 Old &amp; use: [http://x&amp;y]
-!! result
+!! html
 <p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
 </p>
 !! end
 
 !! test
 External links: [encoded equals] (bug 6102)
 <p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
 </p>
 !! end
 
 !! test
 External links: [encoded equals] (bug 6102)
-!! input
+!! wikitext
 [http://example.com/?foo&#61;bar]
 [http://example.com/?foo&#61;bar]
-!! result
+!! html
 <p><a rel="nofollow" class="external autonumber" href="http://example.com/?foo=bar">[1]</a>
 </p>
 !! end
 
 !! test
 External links: [IDN ignored character reference in hostname; strip it right off]
 <p><a rel="nofollow" class="external autonumber" href="http://example.com/?foo=bar">[1]</a>
 </p>
 !! end
 
 !! test
 External links: [IDN ignored character reference in hostname; strip it right off]
-!! input
+!! wikitext
 [http://e&zwnj;xample.com/]
 [http://e&zwnj;xample.com/]
-!! result
+!! html
 <p><a rel="nofollow" class="external autonumber" href="http://example.com/">[1]</a>
 </p>
 !! end
 <p><a rel="nofollow" class="external autonumber" href="http://example.com/">[1]</a>
 </p>
 !! end
@@ -3677,118 +3672,118 @@ External links: [IDN ignored character reference in hostname; strip it right off
 # The Parsoid team.
 !! test
 External links: IDN ignored character reference in hostname; strip it right off
 # The Parsoid team.
 !! test
 External links: IDN ignored character reference in hostname; strip it right off
-!! input
+!! wikitext
 http://e&zwnj;xample.com/
 http://e&zwnj;xample.com/
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>
 </p>
 !! end
 
 !! test
 External links: www.jpeg.org (bug 554)
 <p><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>
 </p>
 !! end
 
 !! test
 External links: www.jpeg.org (bug 554)
-!! input
+!! wikitext
 http://www.jpeg.org
 http://www.jpeg.org
-!!result
+!! html
 <p><a rel="nofollow" class="external free" href="http://www.jpeg.org">http://www.jpeg.org</a>
 </p>
 !! end
 
 !! test
 External links: URL within URL (original bug 2)
 <p><a rel="nofollow" class="external free" href="http://www.jpeg.org">http://www.jpeg.org</a>
 </p>
 !! end
 
 !! test
 External links: URL within URL (original bug 2)
-!! input
+!! wikitext
 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
-!! result
+!! html
 <p><a rel="nofollow" class="external autonumber" href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp">[1]</a>
 </p>
 !! end
 
 !! test
 BUG 361: URL inside bracketed URL
 <p><a rel="nofollow" class="external autonumber" href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp">[1]</a>
 </p>
 !! end
 
 !! test
 BUG 361: URL inside bracketed URL
-!! input
+!! wikitext
 [http://www.example.com/foo http://www.example.com/bar]
 [http://www.example.com/foo http://www.example.com/bar]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://www.example.com/foo">http://www.example.com/bar</a>
 </p>
 !! end
 
 !! test
 BUG 361: URL within URL, not bracketed
 <p><a rel="nofollow" class="external text" href="http://www.example.com/foo">http://www.example.com/bar</a>
 </p>
 !! end
 
 !! test
 BUG 361: URL within URL, not bracketed
-!! input
+!! wikitext
 http://www.example.com/foo?=http://www.example.com/bar
 http://www.example.com/foo?=http://www.example.com/bar
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://www.example.com/foo?=http://www.example.com/bar">http://www.example.com/foo?=http://www.example.com/bar</a>
 </p>
 !! end
 
 !! test
 BUG 289: ">"-token in URL-tail
 <p><a rel="nofollow" class="external free" href="http://www.example.com/foo?=http://www.example.com/bar">http://www.example.com/foo?=http://www.example.com/bar</a>
 </p>
 !! end
 
 !! test
 BUG 289: ">"-token in URL-tail
-!! input
+!! wikitext
 http://www.example.com/<hello>
 http://www.example.com/<hello>
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>&lt;hello&gt;
 </p>
 !!end
 
 !! test
 BUG 289: literal ">"-token in URL-tail
 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>&lt;hello&gt;
 </p>
 !!end
 
 !! test
 BUG 289: literal ">"-token in URL-tail
-!! input
+!! wikitext
 http://www.example.com/<b>html</b>
 http://www.example.com/<b>html</b>
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a><b>html</b>
 </p>
 !!end
 
 !! test
 BUG 289: ">"-token in bracketed URL
 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a><b>html</b>
 </p>
 !!end
 
 !! test
 BUG 289: ">"-token in bracketed URL
-!! input
+!! wikitext
 [http://www.example.com/<hello> stuff]
 [http://www.example.com/<hello> stuff]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://www.example.com/">&lt;hello&gt; stuff</a>
 </p>
 !!end
 
 !! test
 BUG 289: literal ">"-token in bracketed URL
 <p><a rel="nofollow" class="external text" href="http://www.example.com/">&lt;hello&gt; stuff</a>
 </p>
 !!end
 
 !! test
 BUG 289: literal ">"-token in bracketed URL
-!! input
+!! wikitext
 [http://www.example.com/<b>html</b> stuff]
 [http://www.example.com/<b>html</b> stuff]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://www.example.com/"><b>html</b> stuff</a>
 </p>
 !!end
 
 !! test
 BUG 289: literal double quote at end of URL
 <p><a rel="nofollow" class="external text" href="http://www.example.com/"><b>html</b> stuff</a>
 </p>
 !!end
 
 !! test
 BUG 289: literal double quote at end of URL
-!! input
+!! wikitext
 http://www.example.com/"hello"
 http://www.example.com/"hello"
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>"hello"
 </p>
 !!end
 
 !! test
 BUG 289: literal double quote in bracketed URL
 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>"hello"
 </p>
 !!end
 
 !! test
 BUG 289: literal double quote in bracketed URL
-!! input
+!! wikitext
 [http://www.example.com/"hello" stuff]
 [http://www.example.com/"hello" stuff]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://www.example.com/">"hello" stuff</a>
 </p>
 !!end
 
 !! test
 External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081)
 <p><a rel="nofollow" class="external text" href="http://www.example.com/">"hello" stuff</a>
 </p>
 !!end
 
 !! test
 External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081)
-!! input
+!! wikitext
 [http://www.example.com  test]
 [http://www.example.com  test]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://www.example.com">test</a>
 </p>
 !! end
 
 !! test
 External links: link text with spaces
 <p><a rel="nofollow" class="external text" href="http://www.example.com">test</a>
 </p>
 !! end
 
 !! test
 External links: link text with spaces
-!! input
+!! wikitext
 [http://www.example.com a b c]
 [http://www.example.com ''a'' ''b'']
 [http://www.example.com a b c]
 [http://www.example.com ''a'' ''b'']
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://www.example.com">a b c</a>
 <a rel="nofollow" class="external text" href="http://www.example.com"><i>a</i> <i>b</i></a>
 </p>
 <p><a rel="nofollow" class="external text" href="http://www.example.com">a b c</a>
 <a rel="nofollow" class="external text" href="http://www.example.com"><i>a</i> <i>b</i></a>
 </p>
@@ -3796,32 +3791,22 @@ External links: link text with spaces
 
 !! test
 External links: wiki links within external link (Bug 3695)
 
 !! test
 External links: wiki links within external link (Bug 3695)
-!! options
-php
-!! input
+!! wikitext
 [http://example.com [[wikilink]] embedded in ext link]
 [http://example.com [[wikilink]] embedded in ext link]
-!! result
+!! html/php
 <p><a rel="nofollow" class="external text" href="http://example.com"></a><a href="/index.php?title=Wikilink&amp;action=edit&amp;redlink=1" class="new" title="Wikilink (page does not exist)">wikilink</a><a rel="nofollow" class="external text" href="http://example.com"> embedded in ext link</a>
 </p>
 <p><a rel="nofollow" class="external text" href="http://example.com"></a><a href="/index.php?title=Wikilink&amp;action=edit&amp;redlink=1" class="new" title="Wikilink (page does not exist)">wikilink</a><a rel="nofollow" class="external text" href="http://example.com"> embedded in ext link</a>
 </p>
-!! end
-
-!! test
-Parsoid: External links: wiki links within external link (Bug 3695)
-!! options
-parsoid
-!! input
-[http://example.com [[wikilink]] embedded in ext link]
-!! result
+!! html/parsoid
 <p><a rel="mw:ExtLink" href="http://example.com"></a><a rel="mw:WikiLink" href="./Wikilink">wikilink</a><span> embedded in ext link</span></p>
 !! end
 
 !! test
 BUG 787: Links with one slash after the url protocol are invalid
 <p><a rel="mw:ExtLink" href="http://example.com"></a><a rel="mw:WikiLink" href="./Wikilink">wikilink</a><span> embedded in ext link</span></p>
 !! end
 
 !! test
 BUG 787: Links with one slash after the url protocol are invalid
-!! input
+!! wikitext
 http:/example.com
 
 [http:/example.com title]
 http:/example.com
 
 [http:/example.com title]
-!! result
+!! html
 <p>http:/example.com
 </p><p>[http:/example.com title]
 </p>
 <p>http:/example.com
 </p><p>[http:/example.com title]
 </p>
@@ -3829,22 +3814,22 @@ http:/example.com
 
 !! test
 Bracketed external links with template-generated invalid target
 
 !! test
 Bracketed external links with template-generated invalid target
-!! input
+!! wikitext
 [{{echo|http:/example.com}} title]
 [{{echo|http:/example.com}} title]
-!! result
+!! html
 <p>[http:/example.com title]
 </p>
 !! end
 
 !! test
 Bug 2702: Mismatched <i>, <b> and <a> tags are invalid
 <p>[http:/example.com title]
 </p>
 !! end
 
 !! test
 Bug 2702: Mismatched <i>, <b> and <a> tags are invalid
-!! input
+!! wikitext
 ''[http://example.com text'']
 [http://example.com '''text]'''
 ''Something [http://example.com in italic'']
 ''Something [http://example.com mixed''''', even bold]'''
 '''''Now [http://example.com both''''']
 ''[http://example.com text'']
 [http://example.com '''text]'''
 ''Something [http://example.com in italic'']
 ''Something [http://example.com mixed''''', even bold]'''
 '''''Now [http://example.com both''''']
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://example.com"><i>text</i></a>
 <a rel="nofollow" class="external text" href="http://example.com"><b>text</b></a>
 <i>Something </i><a rel="nofollow" class="external text" href="http://example.com"><i>in italic</i></a>
 <p><a rel="nofollow" class="external text" href="http://example.com"><i>text</i></a>
 <a rel="nofollow" class="external text" href="http://example.com"><b>text</b></a>
 <i>Something </i><a rel="nofollow" class="external text" href="http://example.com"><i>in italic</i></a>
@@ -3856,9 +3841,9 @@ Bug 2702: Mismatched <i>, <b> and <a> tags are invalid
 
 !! test
 Bug 4781: %26 in URL
 
 !! test
 Bug 4781: %26 in URL
-!! input
+!! wikitext
 http://www.example.com/?title=AT%26T
 http://www.example.com/?title=AT%26T
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=AT%26T">http://www.example.com/?title=AT%26T</a>
 </p>
 !! end
 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=AT%26T">http://www.example.com/?title=AT%26T</a>
 </p>
 !! end
@@ -3867,18 +3852,18 @@ http://www.example.com/?title=AT%26T
 # % is actually legal in HTML5. Any change in output would need testing though.
 !! test
 Bug 4781, 5267: %25 in URL
 # % is actually legal in HTML5. Any change in output would need testing though.
 !! test
 Bug 4781, 5267: %25 in URL
-!! input
+!! wikitext
 http://www.example.com/?title=100%25_Bran
 http://www.example.com/?title=100%25_Bran
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=100%25_Bran">http://www.example.com/?title=100%25_Bran</a>
 </p>
 !! end
 
 !! test
 Bug 4781, 5267: %28, %29 in URL
 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=100%25_Bran">http://www.example.com/?title=100%25_Bran</a>
 </p>
 !! end
 
 !! test
 Bug 4781, 5267: %28, %29 in URL
-!! input
+!! wikitext
 http://www.example.com/?title=Ben-Hur_%281959_film%29
 http://www.example.com/?title=Ben-Hur_%281959_film%29
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">http://www.example.com/?title=Ben-Hur_%281959_film%29</a>
 </p>
 !! end
 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">http://www.example.com/?title=Ben-Hur_%281959_film%29</a>
 </p>
 !! end
@@ -3886,27 +3871,27 @@ http://www.example.com/?title=Ben-Hur_%281959_film%29
 
 !! test
 Bug 4781: %26 in autonumber URL
 
 !! test
 Bug 4781: %26 in autonumber URL
-!! input
+!! wikitext
 [http://www.example.com/?title=AT%26T]
 [http://www.example.com/?title=AT%26T]
-!! result
+!! html
 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=AT%26T">[1]</a>
 </p>
 !! end
 
 !! test
 Bug 4781, 5267: %26 in autonumber URL
 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=AT%26T">[1]</a>
 </p>
 !! end
 
 !! test
 Bug 4781, 5267: %26 in autonumber URL
-!! input
+!! wikitext
 [http://www.example.com/?title=100%25_Bran]
 [http://www.example.com/?title=100%25_Bran]
-!! result
+!! html
 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=100%25_Bran">[1]</a>
 </p>
 !! end
 
 !! test
 Bug 4781, 5267: %28, %29 in autonumber URL
 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=100%25_Bran">[1]</a>
 </p>
 !! end
 
 !! test
 Bug 4781, 5267: %28, %29 in autonumber URL
-!! input
+!! wikitext
 [http://www.example.com/?title=Ben-Hur_%281959_film%29]
 [http://www.example.com/?title=Ben-Hur_%281959_film%29]
-!! result
+!! html
 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">[1]</a>
 </p>
 !! end
 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">[1]</a>
 </p>
 !! end
@@ -3914,104 +3899,94 @@ Bug 4781, 5267: %28, %29 in autonumber URL
 
 !! test
 Bug 4781: %26 in bracketed URL
 
 !! test
 Bug 4781: %26 in bracketed URL
-!! input
+!! wikitext
 [http://www.example.com/?title=AT%26T link]
 [http://www.example.com/?title=AT%26T link]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=AT%26T">link</a>
 </p>
 !! end
 
 !! test
 Bug 4781, 5267: %26 in bracketed URL
 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=AT%26T">link</a>
 </p>
 !! end
 
 !! test
 Bug 4781, 5267: %26 in bracketed URL
-!! input
+!! wikitext
 [http://www.example.com/?title=100%25_Bran link]
 [http://www.example.com/?title=100%25_Bran link]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=100%25_Bran">link</a>
 </p>
 !! end
 
 !! test
 Bug 4781, 5267: %28, %29 in bracketed URL
 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=100%25_Bran">link</a>
 </p>
 !! end
 
 !! test
 Bug 4781, 5267: %28, %29 in bracketed URL
-!! input
+!! wikitext
 [http://www.example.com/?title=Ben-Hur_%281959_film%29 link]
 [http://www.example.com/?title=Ben-Hur_%281959_film%29 link]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">link</a>
 </p>
 !! end
 
 !! test
 External link containing double-single-quotes in text '' (bug 4598 sanity check)
 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">link</a>
 </p>
 !! end
 
 !! test
 External link containing double-single-quotes in text '' (bug 4598 sanity check)
-!! input
+!! wikitext
 Some [http://example.com/ pretty ''italics'' and stuff]!
 Some [http://example.com/ pretty ''italics'' and stuff]!
-!! result
+!! html
 <p>Some <a rel="nofollow" class="external text" href="http://example.com/">pretty <i>italics</i> and stuff</a>!
 </p>
 !! end
 
 !! test
 External link containing double-single-quotes in text embedded in italics (bug 4598 sanity check)
 <p>Some <a rel="nofollow" class="external text" href="http://example.com/">pretty <i>italics</i> and stuff</a>!
 </p>
 !! end
 
 !! test
 External link containing double-single-quotes in text embedded in italics (bug 4598 sanity check)
-!! input
+!! wikitext
 ''Some [http://example.com/ pretty ''italics'' and stuff]!''
 ''Some [http://example.com/ pretty ''italics'' and stuff]!''
-!! result
+!! html
 <p><i>Some </i><a rel="nofollow" class="external text" href="http://example.com/"><i>pretty </i>italics<i> and stuff</i></a><i>!</i>
 </p>
 !! end
 
 !! test
 External link containing double-single-quotes with no space separating the url from text in italics
 <p><i>Some </i><a rel="nofollow" class="external text" href="http://example.com/"><i>pretty </i>italics<i> and stuff</i></a><i>!</i>
 </p>
 !! end
 
 !! test
 External link containing double-single-quotes with no space separating the url from text in italics
-!! options
-php
-!! input
+!! wikitext
 [http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]
 [http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]
-!! result
+!! html/php
 <p><a rel="nofollow" class="external text" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de <a href="/index.php?title=Museo_Picasso_(Par%C3%ADs)&amp;action=edit&amp;redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.</a>
 </p>
 <p><a rel="nofollow" class="external text" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de <a href="/index.php?title=Museo_Picasso_(Par%C3%ADs)&amp;action=edit&amp;redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.</a>
 </p>
-!! end
-
-!! test
-Parsoid:External link containing double-single-quotes with no space separating the url from text in italics
-!! options
-parsoid
-!! input
-[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]
-!! result
+!! html/parsoid
 <p><a rel="mw:ExtLink" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de </a><a rel="mw:WikiLink" href="./Museo_Picasso_(París)">Museo Picasso</a><span>.</span></p>
 !! end
 
 !! test
 External link with comments in link text
 <p><a rel="mw:ExtLink" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de </a><a rel="mw:WikiLink" href="./Museo_Picasso_(París)">Museo Picasso</a><span>.</span></p>
 !! end
 
 !! test
 External link with comments in link text
-!! input
+!! wikitext
 [http://www.google.com Google <!-- comment -->]
 [http://www.google.com Google <!-- comment -->]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="http://www.google.com">Google </a>
 </p>
 !! end
 
 !! test
 URL-encoding in URL functions (single parameter)
 <p><a rel="nofollow" class="external text" href="http://www.google.com">Google </a>
 </p>
 !! end
 
 !! test
 URL-encoding in URL functions (single parameter)
-!! input
+!! wikitext
 {{localurl:Some page|amp=&}}
 {{localurl:Some page|amp=&}}
-!! result
+!! html
 <p>/index.php?title=Some_page&amp;amp=&amp;
 </p>
 !! end
 
 !! test
 URL-encoding in URL functions (multiple parameters)
 <p>/index.php?title=Some_page&amp;amp=&amp;
 </p>
 !! end
 
 !! test
 URL-encoding in URL functions (multiple parameters)
-!! input
+!! wikitext
 {{localurl:Some page|q=?&amp=&}}
 {{localurl:Some page|q=?&amp=&}}
-!! result
+!! html
 <p>/index.php?title=Some_page&amp;q=?&amp;amp=&amp;
 </p>
 !! end
 
 !! test
 Brackets in urls
 <p>/index.php?title=Some_page&amp;q=?&amp;amp=&amp;
 </p>
 !! end
 
 !! test
 Brackets in urls
-!! input
+!! wikitext
 http://example.com/index.php?foozoid%5B%5D=bar
 
 http://example.com/index.php?foozoid&#x5B;&#x5D;=bar
 http://example.com/index.php?foozoid%5B%5D=bar
 
 http://example.com/index.php?foozoid&#x5B;&#x5D;=bar
-!! result
+!! html
 <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>
 <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>
@@ -4021,16 +3996,16 @@ http://example.com/index.php?foozoid&#x5B;&#x5D;=bar
 IPv6 urls (bug 21261)
 !! options
 disabled
 IPv6 urls (bug 21261)
 !! options
 disabled
-!! input
+!! wikitext
 http://[2404:130:0:1000::187:2]/index.php
 http://[2404:130:0:1000::187:2]/index.php
-!! result
+!! html
 <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
 
 !! test
 Non-extlinks in brackets
 <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
 
 !! test
 Non-extlinks in brackets
-!! input
+!! wikitext
 [foo]
 [foo bar]
 [foo ''bar'']
 [foo]
 [foo bar]
 [foo ''bar'']
@@ -4043,7 +4018,7 @@ Non-extlinks in brackets
 [{{echo|foo}}l's errand]
 [url={{echo|foo}}]
 [url=http://example.com]
 [{{echo|foo}}l's errand]
 [url={{echo|foo}}]
 [url=http://example.com]
-!! result
+!! html
 <p>[foo]
 [foo bar]
 [foo <i>bar</i>]
 <p>[foo]
 [foo bar]
 [foo <i>bar</i>]
@@ -4060,32 +4035,31 @@ Non-extlinks in brackets
 !! end
 
 !! test
 !! end
 
 !! test
-Parsoid: Percent encoding in external links
-!! options
-parsoid
-!! input
+Percent encoding in external links
+!! wikitext
 [https://github.com/search?l=&q=ResourceLoader+%40wikimedia Search]
 [https://github.com/search?l=&q=ResourceLoader+%40wikimedia Search]
-!! result
+!! html/php
+<p><a rel="nofollow" class="external text" href="https://github.com/search?l=&amp;q=ResourceLoader+%40wikimedia">Search</a>
+</p>
+!! html/parsoid
 <p><a rel="mw:ExtLink"
 href="https://github.com/search?l=&amp;q=ResourceLoader+%40wikimedia">Search</a></p>
 !! end
 
 !! test
 <p><a rel="mw:ExtLink"
 href="https://github.com/search?l=&amp;q=ResourceLoader+%40wikimedia">Search</a></p>
 !! end
 
 !! test
-Parsoid: use url link syntax for links where the content is equal the link
-target
-!! options
-parsoid
-!! input
+Use url link syntax for links where the content is equal the link target
+!! wikitext
 http://example.com
 http://example.com
-!! result
+!! html/php
+<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
+</p>
+!! html/parsoid
 <p><a rel="mw:ExtLink" href="http://example.com">http://example.com</a></p>
 !! end
 
 !! test
 Parenthesis in external links, especially URL links
 <p><a rel="mw:ExtLink" href="http://example.com">http://example.com</a></p>
 !! end
 
 !! test
 Parenthesis in external links, especially URL links
-!! options
-php
-!! input 
+!! wikitext
 http://example.com)
 
 http://example.com/test)
 http://example.com)
 
 http://example.com/test)
@@ -4101,7 +4075,7 @@ http://example.com/((test)
 http://example.com/a)b
 
 [http://example.com) foo]
 http://example.com/a)b
 
 [http://example.com) foo]
-!! result
+!! html/php
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>)
 </p><p><a rel="nofollow" class="external free" href="http://example.com/test">http://example.com/test</a>)
 </p><p><a rel="nofollow" class="external free" href="http://example.com/(test)">http://example.com/(test)</a>
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>)
 </p><p><a rel="nofollow" class="external free" href="http://example.com/test">http://example.com/test</a>)
 </p><p><a rel="nofollow" class="external free" href="http://example.com/(test)">http://example.com/(test)</a>
@@ -4111,29 +4085,7 @@ http://example.com/a)b
 </p><p><a rel="nofollow" class="external free" href="http://example.com/a)b">http://example.com/a)b</a>
 </p><p><a rel="nofollow" class="external text" href="http://example.com)">foo</a>
 </p>
 </p><p><a rel="nofollow" class="external free" href="http://example.com/a)b">http://example.com/a)b</a>
 </p><p><a rel="nofollow" class="external text" href="http://example.com)">foo</a>
 </p>
-!! end
-
-!! test
-Parenthesis in external links, especially URL links (Parsoid)
-!! options
-parsoid
-!! input 
-http://example.com)
-
-http://example.com/test)
-
-http://example.com/(test)
-
-http://example.com/((test)
-
-(http://example.com/(test))
-
-(http://example.com/(test)))))
-
-http://example.com/a)b
-
-[http://example.com) foo]
-!! result
+!! html/parsoid
 <p><a rel="mw:ExtLink" href="http://example.com">http://example.com</a>)</p>
 <p><a rel="mw:ExtLink" href="http://example.com/test">http://example.com/test</a>)</p>
 <p><a rel="mw:ExtLink" href="http://example.com/(test)">http://example.com/(test)</a></p>
 <p><a rel="mw:ExtLink" href="http://example.com">http://example.com</a>)</p>
 <p><a rel="mw:ExtLink" href="http://example.com/test">http://example.com/test</a>)</p>
 <p><a rel="mw:ExtLink" href="http://example.com/(test)">http://example.com/(test)</a></p>
@@ -4146,16 +4098,18 @@ http://example.com/a)b
 
 !! test
 Parenthesis in external links, w/ transclusion or comment
 
 !! test
 Parenthesis in external links, w/ transclusion or comment
-!! options
-parsoid
-!! input
+!! wikitext
 (http://example.com/{{echo|hi}})
 
 (http://example.com<!-- hi -->)
 (http://example.com/{{echo|hi}})
 
 (http://example.com<!-- hi -->)
-!! result
-<p>(<a data-mw='{"attribs":[[{"txt":"href"},{"html":"http://example.com/&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-mw=\"{&amp;quot;parts&amp;quot;:[{&amp;quot;template&amp;quot;:{&amp;quot;target&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;echo&amp;quot;,&amp;quot;href&amp;quot;:&amp;quot;./Template:Echo&amp;quot;},&amp;quot;params&amp;quot;:{&amp;quot;1&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;hi&amp;quot;}},&amp;quot;i&amp;quot;:0}}]}\" data-parsoid=\"{&amp;quot;dsr&amp;quot;:[20,31,null,null],&amp;quot;pi&amp;quot;:[[{&amp;quot;k&amp;quot;:&amp;quot;1&amp;quot;,&amp;quot;spc&amp;quot;:[&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;]}]]}\">hi&lt;/span>"}]]}' typeof="mw:ExpandedAttrs" about="#mwt2" rel="mw:ExtLink" href="http://example.com/hi" data-parsoid='{"stx":"url","a":{"href":"http://example.com/hi"},"sa":{"href":"http://example.com/{{echo|hi}}"},"dsr":[1,31,0,0]}'>http://example.com/hi</a>)</p>
+!! html/php
+<p>(<a rel="nofollow" class="external free" href="http://example.com/hi">http://example.com/hi</a>)
+</p><p>(<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>)
+</p>
+!! html/parsoid
+<p>(<a data-mw='{"attribs":[[{"txt":"href"},{"html":"http://example.com/&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-mw=\"{&amp;quot;parts&amp;quot;:[{&amp;quot;template&amp;quot;:{&amp;quot;target&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;echo&amp;quot;,&amp;quot;href&amp;quot;:&amp;quot;./Template:Echo&amp;quot;},&amp;quot;params&amp;quot;:{&amp;quot;1&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;hi&amp;quot;}},&amp;quot;i&amp;quot;:0}}]}\" data-parsoid=\"{&amp;quot;dsr&amp;quot;:[20,31,null,null],&amp;quot;pi&amp;quot;:[[{&amp;quot;k&amp;quot;:&amp;quot;1&amp;quot;,&amp;quot;spc&amp;quot;:[&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;]}]]}\">hi&lt;/span>"}]]}' typeof="mw:ExpandedAttrs" about="#mwt2" rel="mw:ExtLink" href="http://example.com/hi" data-parsoid='{"stx":"url","a":{"href":"http://example.com/hi"},"sa":{"href":"http://example.com/{{echo|hi}}"}}'>http://example.com/hi</a>)</p>
 
 
-<p>(<a rel="mw:ExtLink" href="http://example.com" data-parsoid='{"stx":"url","a":{"href":"http://example.com"},"sa":{"href":"http://example.com&lt;!-- hi -->"},"dsr":[35,64,0,0]}'>http://example.com</a>)</p>
+<p>(<a rel="mw:ExtLink" href="http://example.com" data-parsoid='{"stx":"url","a":{"href":"http://example.com"},"sa":{"href":"http://example.com&lt;!-- hi -->"}}'>http://example.com</a>)</p>
 !! end
 
 ###
 !! end
 
 ###
@@ -4164,22 +4118,23 @@ parsoid
 
 !! test
 Quotes
 
 !! test
 Quotes
-!! input
+!! wikitext
 Normal text. '''Bold text.''' Normal text. ''Italic text.''
 
 Normal text. '''''Bold italic text.''''' Normal text.
 Normal text. '''Bold text.''' Normal text. ''Italic text.''
 
 Normal text. '''''Bold italic text.''''' Normal text.
-!!result
+!! html
 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
 </p>
 !! end
 
 
 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
 </p>
 !! end
 
 
+# Parsoid inserts an empty bold tag pair at the end of the line, that the PHP
+# parser strips. The wikitext contains just the first half of the bold
+# quote pair.
 !! test
 !! test
-Unclosed and unmatched quotes (php)
-!! options
-php
-!! input
+Unclosed and unmatched quotes
+!! wikitext
 '''''Bold italic text '''with bold deactivated''' in between.'''''
 
 '''''Bold italic text ''with italic deactivated'' in between.'''''
 '''''Bold italic text '''with bold deactivated''' in between.'''''
 
 '''''Bold italic text ''with italic deactivated'' in between.'''''
@@ -4200,7 +4155,7 @@ Normal text.
 ''Tom'''s car is bigger than ''Susan'''s.
 
 Plain ''italic'''s plain
 ''Tom'''s car is bigger than ''Susan'''s.
 
 Plain ''italic'''s plain
-!! result
+!! html/php
 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
 </p><p><b>Bold text..</b>
 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
 </p><p><b>Bold text..</b>
@@ -4212,36 +4167,7 @@ Plain ''italic'''s plain
 </p><p><i>Tom<b>s car is bigger than </b></i><b>Susan</b>s.
 </p><p>Plain <i>italic'</i>s plain
 </p>
 </p><p><i>Tom<b>s car is bigger than </b></i><b>Susan</b>s.
 </p><p>Plain <i>italic'</i>s plain
 </p>
-!! end
-# Parsoid inserts an empty bold tag pair at the end of the line, that the PHP
-# parser strips. The wikitext contains just the first half of the bold
-# quote pair.
-!! test
-Unclosed and unmatched quotes (parsoid)
-!! options
-parsoid
-!! input
-'''''Bold italic text '''with bold deactivated''' in between.'''''
-
-'''''Bold italic text ''with italic deactivated'' in between.'''''
-
-'''Bold text..
-
-..spanning two paragraphs (should not work).'''
-
-'''Bold tag left open
-
-''Italic tag left open
-
-Normal text.
-
-<!-- Unmatching number of opening, closing tags: -->
-'''This year''''s election ''should'' beat '''last year''''s.
-
-''Tom'''s car is bigger than ''Susan'''s.
-
-Plain ''italic'''s plain
-!! result
+!! html/parsoid
 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
 </p><p><b>Bold text..</b>
 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
 </p><p><b>Bold text..</b>
@@ -4264,24 +4190,16 @@ Plain ''italic'''s plain
 # This should not produce <table></table> as <table><tr><td></td></tr></table>
 # is the bare minimum required by the spec, see:
 # http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables
 # This should not produce <table></table> as <table><tr><td></td></tr></table>
 # is the bare minimum required by the spec, see:
 # http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables
-!! test
-A table with no data. (php)
-!! options
-php
-!! input
-{||}
-!! result
-
-!! end
-
 # Parsoid team replies: empty table tags are legal in HTML5
 !! test
 # Parsoid team replies: empty table tags are legal in HTML5
 !! test
-A table with no data. (parsoid)
+A table with no data.
 !! options
 parsoid=wt2html
 !! options
 parsoid=wt2html
-!! input
+!! wikitext
 {||}
 {||}
-!! result
+!! html/php
+
+!! html/parsoid
 <table></table>
 
 !! end
 <table></table>
 
 !! end
@@ -4290,7 +4208,7 @@ parsoid=wt2html
 A table with stray table end tags on start tag line (wt2html)
 !! options
 parsoid=wt2html
 A table with stray table end tags on start tag line (wt2html)
 !! options
 parsoid=wt2html
-!! input
+!! wikitext
 {|style="color: red;"|}
 
 {|style="color: red;" |}
 {|style="color: red;"|}
 
 {|style="color: red;" |}
@@ -4304,7 +4222,7 @@ parsoid=wt2html
 {|style="color: red;" |} id="foo"
 |foo
 |}
 {|style="color: red;" |} id="foo"
 |foo
 |}
-!! result
+!! html
 <table style="color: red;"></table>
 
 <table style="color: red;">
 <table style="color: red;"></table>
 
 <table style="color: red;">
@@ -4328,54 +4246,41 @@ parsoid=wt2html
 !! end
 
 !! test
 !! end
 
 !! test
-A table with no data (take 2) (parsoid)
-!! options
-parsoid
-!! input
+A table with no data (take 2)
+!! wikitext
 {|
 |}
 {|
 |}
-!! result
+!! html/parsoid
 <table></table>
 !! end
 
 # A table with nothing but a caption is invalid XHTML, we might want to render
 # this as <p>caption</p>
 <table></table>
 !! end
 
 # A table with nothing but a caption is invalid XHTML, we might want to render
 # this as <p>caption</p>
+# Parsoid team replies: table with only a caption is legal in HTML5
 !! test
 !! test
-A table with nothing but a caption (php)
-!! options
-php
-!! input
+A table with nothing but a caption
+!! wikitext
 {|
 |+ caption
 |}
 {|
 |+ caption
 |}
-!! result
+!! html/php
 <table>
 <caption> caption
 </caption><tr><td></td></tr></table>
 
 <table>
 <caption> caption
 </caption><tr><td></td></tr></table>
 
-!! end
-# Parsoid team replies: table with only a caption is legal in HTML5
-!! test
-A table with nothing but a caption (parsoid)
-!! options
-parsoid
-!! input
-{|
-|+ caption
-|}
-!! result
+!! html/parsoid
 <table><caption> caption</caption></table>
 !! end
 
 !! test
 A table with caption with default-spaced attributes and a table row
 <table><caption> caption</caption></table>
 !! end
 
 !! test
 A table with caption with default-spaced attributes and a table row
-!! input
+!! wikitext
 {|
 |+ style="color: red;" | caption1
 |-
 | foo
 |}
 {|
 |+ style="color: red;" | caption1
 |-
 | foo
 |}
-!! result
+!! html
 <table>
 <caption style="color: red;"> caption1
 </caption>
 <table>
 <caption style="color: red;"> caption1
 </caption>
@@ -4387,14 +4292,14 @@ A table with caption with default-spaced attributes and a table row
 
 !! test
 A table with captions with non-default spaced attributes and a table row
 
 !! test
 A table with captions with non-default spaced attributes and a table row
-!! input
+!! wikitext
 {|
 |+style="color: red;"|caption2
 |+ style="color: red;"| caption3
 |-
 | foo
 |}
 {|
 |+style="color: red;"|caption2
 |+ style="color: red;"| caption3
 |-
 | foo
 |}
-!! result
+!! html
 <table>
 <caption style="color: red;">caption2
 </caption>
 <table>
 <caption style="color: red;">caption2
 </caption>
@@ -4408,14 +4313,14 @@ A table with captions with non-default spaced attributes and a table row
 
 !! test
 Table td-cell syntax variations
 
 !! test
 Table td-cell syntax variations
-!! input
+!! wikitext
 {|
 | foo bar foo | baz
 | foo bar foo || baz
 | style='color:red;' | baz
 | style='color:red;' || baz
 |}
 {|
 | foo bar foo | baz
 | foo bar foo || baz
 | style='color:red;' | baz
 | style='color:red;' || baz
 |}
-!! result
+!! html
 <table>
 <tr>
 <td> baz
 <table>
 <tr>
 <td> baz
@@ -4433,13 +4338,13 @@ Table td-cell syntax variations
 
 !! test
 Simple table
 
 !! test
 Simple table
-!! input
+!! wikitext
 {|
 | 1 || 2
 |-
 | 3 || 4
 |}
 {|
 | 1 || 2
 |-
 | 3 || 4
 |}
-!! result
+!! html
 <table>
 <tr>
 <td> 1 </td>
 <table>
 <tr>
 <td> 1 </td>
@@ -4454,13 +4359,13 @@ Simple table
 
 !! test
 Simple table but with multiple dashes for row wikitext
 
 !! test
 Simple table but with multiple dashes for row wikitext
-!! input
+!! wikitext
 {|
 | foo
 |-----
 | bar
 |}
 {|
 | foo
 |-----
 | bar
 |}
-!! result
+!! html
 <table>
 <tr>
 <td> foo
 <table>
 <tr>
 <td> foo
@@ -4472,7 +4377,7 @@ Simple table but with multiple dashes for row wikitext
 !! end
 !! test
 Multiplication table
 !! end
 !! test
 Multiplication table
-!! input
+!! wikitext
 {| border="1" cellpadding="2"
 |+Multiplication table
 |-
 {| border="1" cellpadding="2"
 |+Multiplication table
 |-
@@ -4493,7 +4398,7 @@ Multiplication table
 ! 5
 | 5 || 10 || 15
 |}
 ! 5
 | 5 || 10 || 15
 |}
-!! result
+!! html
 <table border="1" cellpadding="2">
 <caption>Multiplication table
 </caption>
 <table border="1" cellpadding="2">
 <caption>Multiplication table
 </caption>
@@ -4543,11 +4448,11 @@ Multiplication table
 
 !! test
 Accept "||" in table headings
 
 !! test
 Accept "||" in table headings
-!! input
+!! wikitext
 {|
 !h1 || h2
 |}
 {|
 !h1 || h2
 |}
-!! result
+!! html
 <table>
 <tr>
 <th>h1 </th>
 <table>
 <tr>
 <th>h1 </th>
@@ -4558,11 +4463,11 @@ Accept "||" in table headings
 
 !! test
 Accept "||" in indented table headings
 
 !! test
 Accept "||" in indented table headings
-!! input
+!! wikitext
 :{|
 !h1 || h2
 |}
 :{|
 !h1 || h2
 |}
-!! result
+!! html
 <dl><dd><table>
 <tr>
 <th>h1 </th>
 <dl><dd><table>
 <tr>
 <th>h1 </th>
@@ -4573,12 +4478,12 @@ Accept "||" in indented table headings
 
 !! test
 Accept empty attributes in td/th cells (td/th cells starting with leading ||)
 
 !! test
 Accept empty attributes in td/th cells (td/th cells starting with leading ||)
-!! input
+!! wikitext
 {|
 !| h1
 || a
 |}
 {|
 !| h1
 || a
 |}
-!! result
+!! html
 <table>
 <tr>
 <th> h1
 <table>
 <tr>
 <th> h1
@@ -4590,12 +4495,12 @@ Accept empty attributes in td/th cells (td/th cells starting with leading ||)
 
 !!test
 Accept "| !" at start of line in tables (ignore !-attribute)
 
 !!test
 Accept "| !" at start of line in tables (ignore !-attribute)
-!!input
+!! wikitext
 {|
 |-
 | !style="color:red" | bar
 |}
 {|
 |-
 | !style="color:red" | bar
 |}
-!!result
+!! html
 <table>
 
 <tr>
 <table>
 
 <tr>
@@ -4606,7 +4511,7 @@ Accept "| !" at start of line in tables (ignore !-attribute)
 
 !!test
 Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between "|" and +/- 
 
 !!test
 Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between "|" and +/- 
-!!input
+!! wikitext
 {|
 |-
 |style='color:red;'|+1
 {|
 |-
 |style='color:red;'|+1
@@ -4618,7 +4523,7 @@ Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present
 | +1
 | -1
 |}
 | +1
 | -1
 |}
-!!result
+!! html
 <table>
 
 <tr>
 <table>
 
 <tr>
@@ -4645,7 +4550,7 @@ Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present
 
 !! test
 Table rowspan
 
 !! test
 Table rowspan
-!! input
+!! wikitext
 {| border=1
 | Cell 1, row 1
 |rowspan=2| Cell 2, row 1 (and 2)
 {| border=1
 | Cell 1, row 1
 |rowspan=2| Cell 2, row 1 (and 2)
@@ -4654,7 +4559,7 @@ Table rowspan
 | Cell 1, row 2
 | Cell 3, row 2
 |}
 | Cell 1, row 2
 | Cell 3, row 2
 |}
-!! result
+!! html
 <table border="1">
 <tr>
 <td> Cell 1, row 1
 <table border="1">
 <tr>
 <td> Cell 1, row 1
@@ -4673,7 +4578,7 @@ Table rowspan
 
 !! test
 Nested table
 
 !! test
 Nested table
-!! input
+!! wikitext
 {| border=1
 | &alpha;
 |
 {| border=1
 | &alpha;
 |
@@ -4684,7 +4589,7 @@ Nested table
 |}
 |the original table again
 |}
 |}
 |the original table again
 |}
-!! result
+!! html
 <table border="1">
 <tr>
 <td> &#945;
 <table border="1">
 <tr>
 <td> &#945;
@@ -4705,11 +4610,11 @@ Nested table
 
 !! test
 Invalid attributes in table cell (bug 1830)
 
 !! test
 Invalid attributes in table cell (bug 1830)
-!! input
+!! wikitext
 {|
 |Cell:|broken
 |}
 {|
 |Cell:|broken
 |}
-!! result
+!! html
 <table>
 <tr>
 <td>broken
 <table>
 <tr>
 <td>broken
@@ -4720,10 +4625,10 @@ Invalid attributes in table cell (bug 1830)
 
 !! test
 Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html)
 
 !! test
 Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html)
-!! input
+!! wikitext
 {|
 | |[ftp://|x||]" onmouseover="alert(document.cookie)">test
 {|
 | |[ftp://|x||]" onmouseover="alert(document.cookie)">test
-!! result
+!! html
 <table>
 <tr>
 <td>[<a rel="nofollow" class="external free" href="ftp://%7Cx">ftp://%7Cx</a></td>
 <table>
 <tr>
 <td>[<a rel="nofollow" class="external free" href="ftp://%7Cx">ftp://%7Cx</a></td>
@@ -4737,7 +4642,7 @@ Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitec
 
 !! test
 Indented table markup mixed with indented pre content (proposed in bug 6200)
 
 !! test
 Indented table markup mixed with indented pre content (proposed in bug 6200)
-!! input
+!! wikitext
  <table>
  <tr>
  <td>
  <table>
  <tr>
  <td>
@@ -4745,7 +4650,7 @@ Indented table markup mixed with indented pre content (proposed in bug 6200)
  </td>
  </tr>
  </table>
  </td>
  </tr>
  </table>
-!! result
+!! html
  <table>
  <tr>
  <td>
  <table>
  <tr>
  <td>
@@ -4759,12 +4664,12 @@ Indented table markup mixed with indented pre content (proposed in bug 6200)
 
 !! test
 Template-generated table cell attributes and cell content
 
 !! test
 Template-generated table cell attributes and cell content
-!! input
+!! wikitext
 {|
 |{{table_attribs}}
 | {{table_attribs}}
 |}
 {|
 |{{table_attribs}}
 | {{table_attribs}}
 |}
-!! result
+!! html
 <table>
 <tr>
 <td style="color: red"> Foo
 <table>
 <tr>
 <td style="color: red"> Foo
@@ -4776,11 +4681,11 @@ Template-generated table cell attributes and cell content
 
 !! test
 Template-generated table cell attributes and cell content (2)
 
 !! test
 Template-generated table cell attributes and cell content (2)
-!! input
+!! wikitext
 {|
 |align=center {{table_attribs}}
 |}
 {|
 |align=center {{table_attribs}}
 |}
-!! result
+!! html
 <table>
 <tr>
 <td align="center" style="color: red"> Foo
 <table>
 <tr>
 <td align="center" style="color: red"> Foo
@@ -4790,11 +4695,11 @@ Template-generated table cell attributes and cell content (2)
 
 !! test
 Template-generated table cell attributes and cell content (3)
 
 !! test
 Template-generated table cell attributes and cell content (3)
-!! input
+!! wikitext
 {|
 |align=center {{table_cells}}
 |}
 {|
 |align=center {{table_cells}}
 |}
-!! result
+!! html
 <table>
 <tr>
 <td align="center" style="color: red"> Foo </td>
 <table>
 <tr>
 <td align="center" style="color: red"> Foo </td>
@@ -4806,13 +4711,13 @@ Template-generated table cell attributes and cell content (3)
 
 !! test
 Table with row followed by newlines and table heading
 
 !! test
 Table with row followed by newlines and table heading
-!! input
+!! wikitext
 {|
 |-
 
 ! foo
 |}
 {|
 |-
 
 ! foo
 |}
-!! result
+!! html
 <table>
 
 
 <table>
 
 
@@ -4824,13 +4729,13 @@ Table with row followed by newlines and table heading
 
 !! test
 Table with empty line following the start tag
 
 !! test
 Table with empty line following the start tag
-!! input
+!! wikitext
 {|
 
 |-
 | foo
 |}
 {|
 
 |-
 | foo
 |}
-!! result
+!! html
 <table>
 
 
 <table>
 
 
@@ -4844,13 +4749,11 @@ Table with empty line following the start tag
 # the PHP parser. Parsoid implements the behavior below.
 !! test
 Table attributes with empty value
 # the PHP parser. Parsoid implements the behavior below.
 !! test
 Table attributes with empty value
-!! options
-parsoid
-!! input
+!! wikitext
 {|
 | style=| hello
 |}
 {|
 | style=| hello
 |}
-!! result
+!! html/parsoid
 <table>
 <tbody>
 <tr>
 <table>
 <tbody>
 <tr>
@@ -4861,7 +4764,7 @@ parsoid
 
 !! test
 Wikitext table with a lot of comments
 
 !! test
 Wikitext table with a lot of comments
-!! input
+!! wikitext
 {|
 <!-- c0 -->
 | foo
 {|
 <!-- c0 -->
 | foo
@@ -4871,7 +4774,7 @@ Wikitext table with a lot of comments
 |<!-- c4 -->
 <!-- c5 -->
 |}
 |<!-- c4 -->
 <!-- c5 -->
 |}
-!! result
+!! html
 <table>
 <tr>
 <td> foo
 <table>
 <tr>
 <td> foo
@@ -4884,12 +4787,12 @@ Wikitext table with a lot of comments
 
 !! test
 Wikitext table with double-line table cell
 
 !! test
 Wikitext table with double-line table cell
-!! input
+!! wikitext
 {|
 |a
 b
 |}
 {|
 |a
 b
 |}
-!! result
+!! html
 <table>
 <tr>
 <td>a
 <table>
 <tr>
 <td>a
 
 !! test
 Table cell with a single comment
 
 !! test
 Table cell with a single comment
-!! input
+!! wikitext
 {|
 | <!-- c1 -->
 | a
 |}
 {|
 | <!-- c1 -->
 | a
 |}
-!! result
+!! html
 <table>
 <tr>
 <td>
 <table>
 <tr>
 <td>
@@ -4920,15 +4823,13 @@ Table cell with a single comment
 # not parse this kind of table at all. The main focus for Parsoid is on
 # round-tripping, so this output is ok for now. TODO: revisit!
 !! test
 # not parse this kind of table at all. The main focus for Parsoid is on
 # round-tripping, so this output is ok for now. TODO: revisit!
 !! test
-Wikitext table with html-syntax row (Parsoid)
-!! options
-parsoid
-!! input
+Wikitext table with html-syntax row
+!! wikitext
 {|
 |-
 <td>foo</td>
 |}
 {|
 |-
 <td>foo</td>
 |}
-!! result
+!! html/parsoid
 <table>
 <tbody>
 <tr>
 <table>
 <tbody>
 <tr>
@@ -4940,12 +4841,12 @@ Implicit <td> after a |-
 (PHP parser relies on Tidy to add the missing <td> tags)
 !! options
 parsoid=wt2html,wt2wt
 (PHP parser relies on Tidy to add the missing <td> tags)
 !! options
 parsoid=wt2html,wt2wt
-!! input
+!! wikitext
 {|
 |-
 a
 |}
 {|
 |-
 a
 |}
-!! result
+!! html
 <table>
 <tr><td>a</td></tr>
 </table>
 <table>
 <tr><td>a</td></tr>
 </table>
@@ -4956,7 +4857,7 @@ Pres should be recognized in an explicit <td> context, but not in an implicit <t
 (PHP parser relies on Tidy to add the missing <td> tags)
 !! options
 parsoid=wt2html,wt2wt
 (PHP parser relies on Tidy to add the missing <td> tags)
 !! options
 parsoid=wt2html,wt2wt
-!! input
+!! wikitext
 {|
 |-
 |
 {|
 |-
 |
@@ -4964,7 +4865,7 @@ parsoid=wt2html,wt2wt
 |-
  b
 |}
 |-
  b
 |}
-!! result
+!! html
 <table>
 <tbody>
 <tr><td><pre>a</pre></td></tr>
 <table>
 <tbody>
 <tr><td><pre>a</pre></td></tr>
@@ -4978,12 +4879,12 @@ Lists should be recognized in an implicit <td> context
 (PHP parser relies on Tidy to add the missing <td> tags)
 !! options
 parsoid=wt2html,wt2wt
 (PHP parser relies on Tidy to add the missing <td> tags)
 !! options
 parsoid=wt2html,wt2wt
-!! input
+!! wikitext
 {|
 |-
 *a
 |}
 {|
 |-
 *a
 |}
-!! result
+!! html
 <table>
 <tr>
 <td><ul>
 <table>
 <tr>
 <td><ul>
@@ -4997,7 +4898,7 @@ parsoid=wt2html,wt2wt
 Parsoid: Round-trip tables directly followed by content (bug 51219)
 !! options
 parsoid=wt2html,wt2wt
 Parsoid: Round-trip tables directly followed by content (bug 51219)
 !! options
 parsoid=wt2html,wt2wt
-!! input
+!! wikitext
 {|
 |foo
 |} bar
 {|
 |foo
 |} bar
@@ -5005,7 +4906,7 @@ parsoid=wt2html,wt2wt
 {|
 |baz
 |}<b>quux</b>
 {|
 |baz
 |}<b>quux</b>
-!! result
+!! html
 <table><tbody>
 <tr>
 <td>foo</td></tr></tbody></table> bar
 <table><tbody>
 <tr>
 <td>foo</td></tr></tbody></table> bar
@@ -5019,7 +4920,7 @@ parsoid=wt2html,wt2wt
 Parsoid: Default to a newline after tables in new content (bug 51219)
 !! options
 parsoid=html2wt
 Parsoid: Default to a newline after tables in new content (bug 51219)
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 {|
 |foo
 |}
 {|
 |foo
 |}
@@ -5028,7 +4929,7 @@ parsoid=html2wt
 |baz
 |}
 '''quux'''
 |baz
 |}
 '''quux'''
-!! result
+!! html
 <table><tbody>
 <tr><td>foo</td></tr></tbody></table> bar
 <table><tbody>
 <table><tbody>
 <tr><td>foo</td></tr></tbody></table> bar
 <table><tbody>
@@ -5039,11 +4940,11 @@ parsoid=html2wt
 Parsoid: newline inducing block nodes don't suppress <nowiki>
 !! options
 parsoid=html2wt
 Parsoid: newline inducing block nodes don't suppress <nowiki>
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 <nowiki> </nowiki>a
 
 = foo =
 <nowiki> </nowiki>a
 
 = foo =
-!! result
+!! html
  a<h1>foo</h1>
 !! end
 
  a<h1>foo</h1>
 !! end
 
@@ -5052,90 +4953,90 @@ parsoid=html2wt
 ###
 !! test
 Plain link, capitalized
 ###
 !! test
 Plain link, capitalized
-!! input
+!! wikitext
 [[Main Page]]
 [[Main Page]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 </p>
 !! end
 
 !! test
 Plain link, uncapitalized
 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 </p>
 !! end
 
 !! test
 Plain link, uncapitalized
-!! input
+!! wikitext
 [[main Page]]
 [[main Page]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">main Page</a>
 </p>
 !! end
 
 !! test
 Piped link
 <p><a href="/wiki/Main_Page" title="Main Page">main Page</a>
 </p>
 !! end
 
 !! test
 Piped link
-!! input
+!! wikitext
 [[Main Page|The Main Page]]
 [[Main Page|The Main Page]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
 </p>
 !! end
 
 !! test
 Piped link with comment in link text
 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
 </p>
 !! end
 
 !! test
 Piped link with comment in link text
-!! input
+!! wikitext
 [[Main Page|The Main<!--front--> Page]]
 [[Main Page|The Main<!--front--> Page]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
 </p>
 !! end
 
 !! test
 Broken link
 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
 </p>
 !! end
 
 !! test
 Broken link
-!! input
+!! wikitext
 [[Zigzagzogzagzig]]
 [[Zigzagzogzagzig]]
-!! result
+!! html
 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit&amp;redlink=1" class="new" title="Zigzagzogzagzig (page does not exist)">Zigzagzogzagzig</a>
 </p>
 !! end
 
 !! test
 Broken link with fragment
 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit&amp;redlink=1" class="new" title="Zigzagzogzagzig (page does not exist)">Zigzagzogzagzig</a>
 </p>
 !! end
 
 !! test
 Broken link with fragment
-!! input
+!! wikitext
 [[Zigzagzogzagzig#zug]]
 [[Zigzagzogzagzig#zug]]
-!! result
+!! html
 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit&amp;redlink=1" class="new" title="Zigzagzogzagzig (page does not exist)">Zigzagzogzagzig#zug</a>
 </p>
 !! end
 
 !! test
 Special page link with fragment
 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit&amp;redlink=1" class="new" title="Zigzagzogzagzig (page does not exist)">Zigzagzogzagzig#zug</a>
 </p>
 !! end
 
 !! test
 Special page link with fragment
-!! input
+!! wikitext
 [[Special:Version#anchor]]
 [[Special:Version#anchor]]
-!! result
+!! html
 <p><a href="/wiki/Special:Version#anchor" title="Special:Version">Special:Version#anchor</a>
 </p>
 !! end
 
 !! test
 Nonexistent special page link with fragment
 <p><a href="/wiki/Special:Version#anchor" title="Special:Version">Special:Version#anchor</a>
 </p>
 !! end
 
 !! test
 Nonexistent special page link with fragment
-!! input
+!! wikitext
 [[Special:ThisNameWillHopefullyNeverBeUsed#anchor]]
 [[Special:ThisNameWillHopefullyNeverBeUsed#anchor]]
-!! result
+!! html
 <p><a href="/wiki/Special:ThisNameWillHopefullyNeverBeUsed" class="new" title="Special:ThisNameWillHopefullyNeverBeUsed (page does not exist)">Special:ThisNameWillHopefullyNeverBeUsed#anchor</a>
 </p>
 !! end
 
 !! test
 Link with prefix
 <p><a href="/wiki/Special:ThisNameWillHopefullyNeverBeUsed" class="new" title="Special:ThisNameWillHopefullyNeverBeUsed (page does not exist)">Special:ThisNameWillHopefullyNeverBeUsed#anchor</a>
 </p>
 !! end
 
 !! test
 Link with prefix
-!! input
+!! wikitext
 xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
 xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
-!! result
+!! html
 <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
 
 !! test
 Link with suffix
 <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
 
 !! test
 Link with suffix
-!! input
+!! wikitext
 [[Main Page]]xxx, [[Main Page]]XXX, [[Main Page]]!!!
 [[Main Page]]xxx, [[Main Page]]XXX, [[Main Page]]!!!
-!! result
+!! html
 <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><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
@@ -5148,13 +5049,13 @@ Some text
 
 !! test
 Bug 43661: Piped links with identical prefixes
 
 !! test
 Bug 43661: Piped links with identical prefixes
-!! input
+!! wikitext
 [[prefixed article|prefixed articles with spaces]]
 
 [[prefixed article|prefixed articlesaoeu]]
 
 [[Main Page|Main Page test]]
 [[prefixed article|prefixed articles with spaces]]
 
 [[prefixed article|prefixed articlesaoeu]]
 
 [[Main Page|Main Page test]]
-!! result
+!! html
 <p><a href="/wiki/Prefixed_article" title="Prefixed article">prefixed articles with spaces</a>
 </p><p><a href="/wiki/Prefixed_article" title="Prefixed article">prefixed articlesaoeu</a>
 </p><p><a href="/wiki/Main_Page" title="Main Page">Main Page test</a>
 <p><a href="/wiki/Prefixed_article" title="Prefixed article">prefixed articles with spaces</a>
 </p><p><a href="/wiki/Prefixed_article" title="Prefixed article">prefixed articlesaoeu</a>
 </p><p><a href="/wiki/Main_Page" title="Main Page">Main Page test</a>
@@ -5164,37 +5065,46 @@ Bug 43661: Piped links with identical prefixes
 
 !! test
 Link with HTML entity in suffix / tail
 
 !! test
 Link with HTML entity in suffix / tail
-!! input
+!! wikitext
 [[Main Page]]&quot;, [[Main Page]]&#97;
 [[Main Page]]&quot;, [[Main Page]]&#97;
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>&quot;, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>&#97;
 </p>
 !! end
 
 !! test
 Link with 3 brackets
 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>&quot;, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>&#97;
 </p>
 !! end
 
 !! test
 Link with 3 brackets
-!! input
-[[[main page]]]
-!! result
-<p>[[[main page]]]
+!! wikitext
+[[[Main Page]]]
+!! html
+<p>[[[Main Page]]]
+</p>
+!! end
+
+!! test
+Link with 4 brackets
+!! wikitext
+[[[[Main Page]]]]
+!! html
+<p>[[<a href="/wiki/Main_Page" title="Main Page">Main Page</a>]]
 </p>
 !! end
 
 !! test
 Piped link with 3 brackets
 </p>
 !! end
 
 !! test
 Piped link with 3 brackets
-!! input
+!! wikitext
 [[[main page|the main page]]]
 [[[main page|the main page]]]
-!! result
+!! html
 <p>[[[main page|the main page]]]
 </p>
 !! end
 
 !! test
 Piped link with extlink-like text
 <p>[[[main page|the main page]]]
 </p>
 !! end
 
 !! test
 Piped link with extlink-like text
-!! input
+!! wikitext
 [[Main Page|[bar]]]
 [[Main Page|This is a [bar]]]
 [[Main Page|[bar]]]
 [[Main Page|This is a [bar]]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">[bar]</a>
 <a href="/wiki/Main_Page" title="Main Page">This is a [bar]</a>
 </p>
 <p><a href="/wiki/Main_Page" title="Main Page">[bar]</a>
 <a href="/wiki/Main_Page" title="Main Page">This is a [bar]</a>
 </p>
@@ -5202,18 +5112,18 @@ Piped link with extlink-like text
 
 !! test
 Link with multiple pipes
 
 !! test
 Link with multiple pipes
-!! input
+!! wikitext
 [[Main Page|The|Main|Page]]
 [[Main Page|The|Main|Page]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">The|Main|Page</a>
 </p>
 !! end
 
 !! test
 Link to namespaces
 <p><a href="/wiki/Main_Page" title="Main Page">The|Main|Page</a>
 </p>
 !! end
 
 !! test
 Link to namespaces
-!! input
+!! wikitext
 [[Talk:Parser testing]], [[Meta:Disclaimers]]
 [[Talk:Parser testing]], [[Meta:Disclaimers]]
-!! result
+!! html
 <p><a href="/index.php?title=Talk:Parser_testing&amp;action=edit&amp;redlink=1" class="new" title="Talk:Parser testing (page does not exist)">Talk:Parser testing</a>, <a href="/index.php?title=Meta:Disclaimers&amp;action=edit&amp;redlink=1" class="new" title="Meta:Disclaimers (page does not exist)">Meta:Disclaimers</a>
 </p>
 !! end
 <p><a href="/index.php?title=Talk:Parser_testing&amp;action=edit&amp;redlink=1" class="new" title="Talk:Parser testing (page does not exist)">Talk:Parser testing</a>, <a href="/index.php?title=Meta:Disclaimers&amp;action=edit&amp;redlink=1" class="new" title="Meta:Disclaimers (page does not exist)">Meta:Disclaimers</a>
 </p>
 !! end
@@ -5227,9 +5137,9 @@ This is an article in the MemoryAlpha namespace
 
 !! test
 Namespace takes precedence over interwiki link (bug 51680)
 
 !! test
 Namespace takes precedence over interwiki link (bug 51680)
-!! input
+!! wikitext
 [[MemoryAlpha:AlphaTest]]
 [[MemoryAlpha:AlphaTest]]
-!! result
+!! html
 <p><a href="/wiki/MemoryAlpha:AlphaTest" title="MemoryAlpha:AlphaTest">MemoryAlpha:AlphaTest</a>
 </p>
 !! end
 <p><a href="/wiki/MemoryAlpha:AlphaTest" title="MemoryAlpha:AlphaTest">MemoryAlpha:AlphaTest</a>
 </p>
 !! end
@@ -5240,54 +5150,54 @@ Namespace takes precedence over interwiki link (bug 51680)
 Link to namespace preferred over interwiki with correct rel attribute
 !! options
 parsoid=html2wt,html2html
 Link to namespace preferred over interwiki with correct rel attribute
 !! options
 parsoid=html2wt,html2html
-!! input
+!! wikitext
 [[MemoryAlpha:AlphaTest]]
 [[MemoryAlpha:AlphaTest]]
-!! result
+!! html
 <p><a rel="mw:WikiLink" href="./MemoryAlpha:AlphaTest">MemoryAlpha:AlphaTest</a>
 </p>
 !! end
 
 !! test
 Piped link to namespace
 <p><a rel="mw:WikiLink" href="./MemoryAlpha:AlphaTest">MemoryAlpha:AlphaTest</a>
 </p>
 !! end
 
 !! test
 Piped link to namespace
-!! input
+!! wikitext
 [[Meta:Disclaimers|The disclaimers]]
 [[Meta:Disclaimers|The disclaimers]]
-!! result
+!! html
 <p><a href="/index.php?title=Meta:Disclaimers&amp;action=edit&amp;redlink=1" class="new" title="Meta:Disclaimers (page does not exist)">The disclaimers</a>
 </p>
 !! end
 
 !! test
 Link containing }
 <p><a href="/index.php?title=Meta:Disclaimers&amp;action=edit&amp;redlink=1" class="new" title="Meta:Disclaimers (page does not exist)">The disclaimers</a>
 </p>
 !! end
 
 !! test
 Link containing }
-!! input
+!! wikitext
 [[Usually caused by a typo (oops}]]
 [[Usually caused by a typo (oops}]]
-!! result
+!! html
 <p>[[Usually caused by a typo (oops}]]
 </p>
 !! end
 
 !! test
 Link containing % (not as a hex sequence)
 <p>[[Usually caused by a typo (oops}]]
 </p>
 !! end
 
 !! test
 Link containing % (not as a hex sequence)
-!! input
+!! wikitext
 [[7% Solution]]
 [[7% Solution]]
-!! result
+!! html
 <p><a href="/index.php?title=7%25_Solution&amp;action=edit&amp;redlink=1" class="new" title="7% Solution (page does not exist)">7% Solution</a>
 </p>
 !! end
 
 !! test
 Link containing % as a single hex sequence interpreted to char
 <p><a href="/index.php?title=7%25_Solution&amp;action=edit&amp;redlink=1" class="new" title="7% Solution (page does not exist)">7% Solution</a>
 </p>
 !! end
 
 !! test
 Link containing % as a single hex sequence interpreted to char
-!! input
+!! wikitext
 [[7%25 Solution]]
 [[7%25 Solution]]
-!! result
+!! html
 <p><a href="/index.php?title=7%25_Solution&amp;action=edit&amp;redlink=1" class="new" title="7% Solution (page does not exist)">7% Solution</a>
 </p>
 !!end
 
 !! test
 Link containing % as a double hex sequence interpreted to hex sequence
 <p><a href="/index.php?title=7%25_Solution&amp;action=edit&amp;redlink=1" class="new" title="7% Solution (page does not exist)">7% Solution</a>
 </p>
 !!end
 
 !! test
 Link containing % as a double hex sequence interpreted to hex sequence
-!! input
+!! wikitext
 [[7%2525 Solution]]
 [[7%2525 Solution]]
-!! result
+!! html
 <p>[[7%2525 Solution]]
 </p>
 !!end
 <p>[[7%2525 Solution]]
 </p>
 !!end
@@ -5295,27 +5205,27 @@ Link containing % as a double hex sequence interpreted to hex sequence
 !! test
 Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors
 Example for such a section: == < ==
 !! test
 Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors
 Example for such a section: == < ==
-!! input
+!! wikitext
 [[%23%3c]][[%23%3e]]
 [[%23%3c]][[%23%3e]]
-!! result
+!! html
 <p><a href="#.3C">#&lt;</a><a href="#.3E">#&gt;</a>
 </p>
 !! end
 
 !! test
 Link containing "<#" and ">#" as a hex sequences
 <p><a href="#.3C">#&lt;</a><a href="#.3E">#&gt;</a>
 </p>
 !! end
 
 !! test
 Link containing "<#" and ">#" as a hex sequences
-!! input
+!! wikitext
 [[%3c%23]][[%3e%23]]
 [[%3c%23]][[%3e%23]]
-!! result
+!! html
 <p>[[%3c%23]][[%3e%23]]
 </p>
 !! end
 
 !! test
 Link containing an equals sign
 <p>[[%3c%23]][[%3e%23]]
 </p>
 !! end
 
 !! test
 Link containing an equals sign
-!! input
+!! wikitext
 [[Special:BookSources/isbn=4-00-026157-6]]
 [[Special:BookSources/isbn=4-00-026157-6]]
-!! result
+!! html
 <p><a href="/wiki/Special:BookSources/isbn%3D4-00-026157-6" title="Special:BookSources/isbn=4-00-026157-6">Special:BookSources/isbn=4-00-026157-6</a>
 </p>
 !! end
 <p><a href="/wiki/Special:BookSources/isbn%3D4-00-026157-6" title="Special:BookSources/isbn=4-00-026157-6">Special:BookSources/isbn=4-00-026157-6</a>
 </p>
 !! end
@@ -5331,43 +5241,43 @@ Just a test of an article title containing a tilde.
 # seen by the parser.
 !! test
 Link containing a tilde
 # seen by the parser.
 !! test
 Link containing a tilde
-!! input
+!! wikitext
 [[Foo~bar]]
 [[Foo~bar]]
-!! result
+!! html
 <p><a href="/wiki/Foo%7Ebar" title="Foo~bar">Foo~bar</a>
 </p>
 !! end
 
 !! test
 Link containing double-single-quotes '' (bug 4598)
 <p><a href="/wiki/Foo%7Ebar" title="Foo~bar">Foo~bar</a>
 </p>
 !! end
 
 !! test
 Link containing double-single-quotes '' (bug 4598)
-!! input
+!! wikitext
 [[Lista d''e paise d''o munno]]
 [[Lista d''e paise d''o munno]]
-!! result
+!! html
 <p><a href="/index.php?title=Lista_d%27%27e_paise_d%27%27o_munno&amp;action=edit&amp;redlink=1" class="new" title="Lista d''e paise d''o munno (page does not exist)">Lista d''e paise d''o munno</a>
 </p>
 !! end
 
 !! test
 Link containing double-single-quotes '' in text (bug 4598 sanity check)
 <p><a href="/index.php?title=Lista_d%27%27e_paise_d%27%27o_munno&amp;action=edit&amp;redlink=1" class="new" title="Lista d''e paise d''o munno (page does not exist)">Lista d''e paise d''o munno</a>
 </p>
 !! end
 
 !! test
 Link containing double-single-quotes '' in text (bug 4598 sanity check)
-!! input
+!! wikitext
 Some [[Link|pretty ''italics'' and stuff]]!
 Some [[Link|pretty ''italics'' and stuff]]!
-!! result
+!! html
 <p>Some <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!
 </p>
 !! end
 
 !! test
 Link containing double-single-quotes '' in text embedded in italics (bug 4598 sanity check)
 <p>Some <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!
 </p>
 !! end
 
 !! test
 Link containing double-single-quotes '' in text embedded in italics (bug 4598 sanity check)
-!! input
+!! wikitext
 ''Some [[Link|pretty ''italics'' and stuff]]!
 ''Some [[Link|pretty ''italics'' and stuff]]!
-!! result
+!! html
 <p><i>Some <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!</i>
 </p>
 !! end
 
 !! test
 Link with double quotes in title part (literal) and alternate part (interpreted)
 <p><i>Some <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!</i>
 </p>
 !! end
 
 !! test
 Link with double quotes in title part (literal) and alternate part (interpreted)
-!! input
+!! wikitext
 [[File:Denys Savchenko ''Pentecoste''.jpg]]
 
 [[''Pentecoste'']]
 [[File:Denys Savchenko ''Pentecoste''.jpg]]
 
 [[''Pentecoste'']]
@@ -5375,7 +5285,7 @@ Link with double quotes in title part (literal) and alternate part (interpreted)
 [[''Pentecoste''|Pentecoste]]
 
 [[''Pentecoste''|''Pentecoste'']]
 [[''Pentecoste''|Pentecoste]]
 
 [[''Pentecoste''|''Pentecoste'']]
-!! result
+!! html
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Denys_Savchenko_%27%27Pentecoste%27%27.jpg" class="new" title="File:Denys Savchenko &#39;&#39;Pentecoste&#39;&#39;.jpg">File:Denys Savchenko <i>Pentecoste</i>.jpg</a>
 </p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">''Pentecoste''</a>
 </p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">Pentecoste</a>
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Denys_Savchenko_%27%27Pentecoste%27%27.jpg" class="new" title="File:Denys Savchenko &#39;&#39;Pentecoste&#39;&#39;.jpg">File:Denys Savchenko <i>Pentecoste</i>.jpg</a>
 </p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">''Pentecoste''</a>
 </p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">Pentecoste</a>
@@ -5385,12 +5295,12 @@ Link with double quotes in title part (literal) and alternate part (interpreted)
 
 !! test
 Broken image links with HTML captions (bug 39700)
 
 !! test
 Broken image links with HTML captions (bug 39700)
-!! input
+!! wikitext
 [[File:Nonexistent|<script></script>]]
 [[File:Nonexistent|100px|<script></script>]]
 [[File:Nonexistent|&lt;]]
 [[File:Nonexistent|a<i>b</i>c]]
 [[File:Nonexistent|<script></script>]]
 [[File:Nonexistent|100px|<script></script>]]
 [[File:Nonexistent|&lt;]]
 [[File:Nonexistent|a<i>b</i>c]]
-!! result
+!! html
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Nonexistent" class="new" title="File:Nonexistent">&lt;script&gt;&lt;/script&gt;</a>
 <a href="/index.php?title=Special:Upload&amp;wpDestFile=Nonexistent" class="new" title="File:Nonexistent">&lt;script&gt;&lt;/script&gt;</a>
 <a href="/index.php?title=Special:Upload&amp;wpDestFile=Nonexistent" class="new" title="File:Nonexistent">&lt;</a>
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Nonexistent" class="new" title="File:Nonexistent">&lt;script&gt;&lt;/script&gt;</a>
 <a href="/index.php?title=Special:Upload&amp;wpDestFile=Nonexistent" class="new" title="File:Nonexistent">&lt;script&gt;&lt;/script&gt;</a>
 <a href="/index.php?title=Special:Upload&amp;wpDestFile=Nonexistent" class="new" title="File:Nonexistent">&lt;</a>
@@ -5400,47 +5310,47 @@ Broken image links with HTML captions (bug 39700)
 
 !! test
 Plain link to URL
 
 !! test
 Plain link to URL
-!! input
+!! wikitext
 [[http://www.example.com]]
 [[http://www.example.com]]
-!! result
+!! html
 <p>[<a rel="nofollow" class="external autonumber" href="http://www.example.com">[1]</a>]
 </p>
 !! end
 
 !! test
 Plain link to URL with link text
 <p>[<a rel="nofollow" class="external autonumber" href="http://www.example.com">[1]</a>]
 </p>
 !! end
 
 !! test
 Plain link to URL with link text
-!! input
+!! wikitext
 [[http://www.example.com Link text]]
 [[http://www.example.com Link text]]
-!! result
+!! html
 <p>[<a rel="nofollow" class="external text" href="http://www.example.com">Link text</a>]
 </p>
 !! end
 
 !! test
 Plain link to protocol-relative URL
 <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
+!! wikitext
 [[//www.example.com]]
 [[//www.example.com]]
-!! result
+!! html
 <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
 <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
+!! wikitext
 [[//www.example.com Link text]]
 [[//www.example.com Link text]]
-!! result
+!! html
 <p>[<a rel="nofollow" class="external text" href="//www.example.com">Link text</a>]
 </p>
 !! end
 
 !! test
 Plain link to page with question mark in title
 <p>[<a rel="nofollow" class="external text" href="//www.example.com">Link text</a>]
 </p>
 !! end
 
 !! test
 Plain link to page with question mark in title
-!! input
+!! wikitext
 [[A?b]]
 
 [[A?b|Baz]]
 [[A?b]]
 
 [[A?b|Baz]]
-!! result
+!! html
 <p><a href="/wiki/A%3Fb" title="A?b">A?b</a>
 </p><p><a href="/wiki/A%3Fb" title="A?b">Baz</a>
 </p>
 <p><a href="/wiki/A%3Fb" title="A?b">A?b</a>
 </p><p><a href="/wiki/A%3Fb" title="A?b">Baz</a>
 </p>
@@ -5460,18 +5370,18 @@ Plain link to page with question mark in title
 # -- wtm
 !! test
 Piped link to URL
 # -- wtm
 !! test
 Piped link to URL
-!! input
+!! wikitext
 Piped link to URL: [[http://www.example.com|an example URL]]
 Piped link to URL: [[http://www.example.com|an example URL]]
-!! result
+!! html
 <p>Piped link to URL: [<a rel="nofollow" class="external text" href="http://www.example.com%7Can">example URL</a>]
 </p>
 !! end
 
 !! test
 BUG 2: [[page|http://url/]] should link to page, not http://url/
 <p>Piped link to URL: [<a rel="nofollow" class="external text" href="http://www.example.com%7Can">example URL</a>]
 </p>
 !! end
 
 !! test
 BUG 2: [[page|http://url/]] should link to page, not http://url/
-!! input
+!! wikitext
 [[Main Page|http://url/]]
 [[Main Page|http://url/]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">http://url/</a>
 </p>
 !! end
 <p><a href="/wiki/Main_Page" title="Main Page">http://url/</a>
 </p>
 !! end
@@ -5480,9 +5390,9 @@ BUG 2: [[page|http://url/]] should link to page, not http://url/
 BUG 337: Escaped self-links should be bold
 !! options
 title=[[Bug462]]
 BUG 337: Escaped self-links should be bold
 !! options
 title=[[Bug462]]
-!! input
+!! wikitext
 [[Bu&#103;462]] [[Bug462]]
 [[Bu&#103;462]] [[Bug462]]
-!! result
+!! html
 <p><strong class="selflink">Bu&#103;462</strong> <strong class="selflink">Bug462</strong>
 </p>
 !! end
 <p><strong class="selflink">Bu&#103;462</strong> <strong class="selflink">Bug462</strong>
 </p>
 !! end
@@ -5491,9 +5401,9 @@ title=[[Bug462]]
 Self-link to section should not be bold
 !! options
 title=[[Main Page]]
 Self-link to section should not be bold
 !! options
 title=[[Main Page]]
-!! input
+!! wikitext
 [[Main Page#section]]
 [[Main Page#section]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page#section" title="Main Page">Main Page#section</a>
 </p>
 !! end
 <p><a href="/wiki/Main_Page#section" title="Main Page">Main Page#section</a>
 </p>
 !! end
@@ -5508,9 +5418,9 @@ This is 00.
 Self-link to numeric title
 !!options
 title=[[0]]
 Self-link to numeric title
 !!options
 title=[[0]]
-!!input
+!! wikitext
 [[0]]
 [[0]]
-!!result
+!! html
 <p><strong class="selflink">0</strong>
 </p>
 !!end
 <p><strong class="selflink">0</strong>
 </p>
 !!end
@@ -5519,27 +5429,27 @@ title=[[0]]
 Link to numeric-equivalent title
 !!options
 title=[[0]]
 Link to numeric-equivalent title
 !!options
 title=[[0]]
-!!input
+!! wikitext
 [[00]]
 [[00]]
-!!result
+!! html
 <p><a href="/wiki/00" title="00">00</a>
 </p>
 !!end
 
 !! test
 <nowiki> inside a link
 <p><a href="/wiki/00" title="00">00</a>
 </p>
 !!end
 
 !! test
 <nowiki> inside a link
-!! input
+!! wikitext
 [[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]
 [[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]
-!! result
+!! html
 <p>[[Main Page]] <a href="/wiki/Main_Page" title="Main Page">the main page [it's not very good]</a>
 </p>
 !! end
 
 !! test
 Non-breaking spaces in title
 <p>[[Main Page]] <a href="/wiki/Main_Page" title="Main Page">the main page [it's not very good]</a>
 </p>
 !! end
 
 !! test
 Non-breaking spaces in title
-!! input
+!! wikitext
 [[&nbsp; Main &nbsp; Page &nbsp;]]
 [[&nbsp; Main &nbsp; Page &nbsp;]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">&#160; Main &#160; Page &#160;</a>
 </p>
 !!end
 <p><a href="/wiki/Main_Page" title="Main Page">&#160; Main &#160; Page &#160;</a>
 </p>
 !!end
@@ -5548,9 +5458,9 @@ Non-breaking spaces in title
 Internal link with ca linktrail, surrounded by bold apostrophes (bug 27473 primary issue)
 !! options
 language=ca
 Internal link with ca linktrail, surrounded by bold apostrophes (bug 27473 primary issue)
 !! options
 language=ca
-!! input
+!! wikitext
 '''[[Main Page]]'''
 '''[[Main Page]]'''
-!! result
+!! html
 <p><b><a href="/wiki/Main_Page" title="Main Page">Main Page</a></b>
 </p>
 !! end
 <p><b><a href="/wiki/Main_Page" title="Main Page">Main Page</a></b>
 </p>
 !! end
@@ -5559,9 +5469,9 @@ language=ca
 Internal link with ca linktrail, surrounded by italic apostrophes (bug 27473 primary issue)
 !! options
 language=ca
 Internal link with ca linktrail, surrounded by italic apostrophes (bug 27473 primary issue)
 !! options
 language=ca
-!! input
+!! wikitext
 ''[[Main Page]]''
 ''[[Main Page]]''
-!! result
+!! html
 <p><i><a href="/wiki/Main_Page" title="Main Page">Main Page</a></i>
 </p>
 !! end
 <p><i><a href="/wiki/Main_Page" title="Main Page">Main Page</a></i>
 </p>
 !! end
@@ -5570,9 +5480,9 @@ language=ca
 Internal link with en linktrail: no apostrophes (bug 27473)
 !! options
 language=en
 Internal link with en linktrail: no apostrophes (bug 27473)
 !! options
 language=en
-!! input
+!! wikitext
 [[Something]]'nice
 [[Something]]'nice
-!! result
+!! html
 <p><a href="/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (page does not exist)">Something</a>'nice
 </p>
 !! end
 <p><a href="/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (page does not exist)">Something</a>'nice
 </p>
 !! end
@@ -5581,9 +5491,9 @@ language=en
 Internal link with ca linktrail with apostrophes (bug 27473)
 !! options
 language=ca
 Internal link with ca linktrail with apostrophes (bug 27473)
 !! options
 language=ca
-!! input
+!! wikitext
 [[Something]]'nice
 [[Something]]'nice
-!! result
+!! html
 <p><a href="/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (encara no existeix)">Something'nice</a>
 </p>
 !! end
 <p><a href="/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (encara no existeix)">Something'nice</a>
 </p>
 !! end
@@ -5592,13 +5502,43 @@ language=ca
 Internal link with kaa linktrail with apostrophes (bug 27473)
 !! options
 language=kaa
 Internal link with kaa linktrail with apostrophes (bug 27473)
 !! options
 language=kaa
-!! input
+!! wikitext
 [[Something]]'nice
 [[Something]]'nice
-!! result
+!! html
 <p><a href="/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (bet ele jaratılmag'an)">Something'nice</a>
 </p>
 !! end
 
 <p><a href="/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (bet ele jaratılmag'an)">Something'nice</a>
 </p>
 !! end
 
+!! test
+1. Interaction of linktrail and template encapsulation
+!! options
+parsoid
+!! wikitext
+{{echo|[[Foo]]}}l
+!! html
+<p><a rel="mw:WikiLink" href="Foo" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Foo]]"}},"i":0}},"l"]}'>Fool</a></p>
+!! end
+
+!! test
+2. Interaction of linktrail and template encapsulation
+!! options
+parsoid
+!! wikitext
+{{echo|Some [[Fool]]}}s
+!! html
+<p data-parsoid='{}'><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"Some [[Fool]]"}},"i":0}},"s"]}' data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}'>Some </span><a rel="mw:WikiLink" href="./Fool" about="#mwt1" data-parsoid='{"stx":"simple","a":{"href":"./Fool"},"sa":{"href":"Fool"},"tail":"s"}'>Fools</a></p>
+!! end
+
+!! test
+3. Interaction of linktrail and template encapsulation
+!! options
+parsoid
+!! wikitext
+{{echo|Some [[Fool]]s are '''bold and foolish'''}}
+!! html
+<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"Some [[Fool]]s are &#39;&#39;&#39;bold and foolish&#39;&#39;&#39;"}},"i":0}}]}' data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}'>Some <a rel="mw:WikiLink" href="./Fool" data-parsoid='{"stx":"simple","a":{"href":"./Fool"},"sa":{"href":"Fool"},"tail":"s"}'>Fools</a> are <b data-parsoid="{}">bold and foolish</b></p>
+!! end
+
 !! article
 Söfnuður
 !! text
 !! article
 Söfnuður
 !! text
@@ -5609,9 +5549,9 @@ Test.
 Internal link with is link prefix
 !! options
 language=is
 Internal link with is link prefix
 !! options
 language=is
-!! input
+!! wikitext
 Aðrir mótmælenda[[söfnuður|söfnuðir]] og
 Aðrir mótmælenda[[söfnuður|söfnuðir]] og
-!! result
+!! html
 <p>Aðrir <a href="/wiki/S%C3%B6fnu%C3%B0ur" title="Söfnuður">mótmælendasöfnuðir</a> og
 </p>
 !! end
 <p>Aðrir <a href="/wiki/S%C3%B6fnu%C3%B0ur" title="Söfnuður">mótmælendasöfnuðir</a> og
 </p>
 !! end
@@ -5626,13 +5566,13 @@ Test.
 Internal link with is link trail and link prefix
 !! options
 language=is
 Internal link with is link trail and link prefix
 !! options
 language=is
-!! input
+!! wikitext
 [[mótmælendatrú|xxx]]ar
 [[mótmælendatrú]]ar
 mótmælenda[[söfnuður]]
 mótmælenda[[söfnuður|söfnuðir]]
 mótmælenda[[söfnuður|söfnuðir]]xxx
 [[mótmælendatrú|xxx]]ar
 [[mótmælendatrú]]ar
 mótmælenda[[söfnuður]]
 mótmælenda[[söfnuður|söfnuðir]]
 mótmælenda[[söfnuður|söfnuðir]]xxx
-!! result
+!! html
 <p><a href="/wiki/M%C3%B3tm%C3%A6lendatr%C3%BA" title="Mótmælendatrú">xxxar</a>
 <a href="/wiki/M%C3%B3tm%C3%A6lendatr%C3%BA" title="Mótmælendatrú">mótmælendatrúar</a>
 <a href="/wiki/S%C3%B6fnu%C3%B0ur" title="Söfnuður">mótmælendasöfnuður</a>
 <p><a href="/wiki/M%C3%B3tm%C3%A6lendatr%C3%BA" title="Mótmælendatrú">xxxar</a>
 <a href="/wiki/M%C3%B3tm%C3%A6lendatr%C3%BA" title="Mótmælendatrú">mótmælendatrúar</a>
 <a href="/wiki/S%C3%B6fnu%C3%B0ur" title="Söfnuður">mótmælendasöfnuður</a>
@@ -5645,9 +5585,9 @@ mótmælenda[[söfnuður|söfnuðir]]xxx
 Parsoid link trail escaping
 !! options
 parsoid=html2wt,html2html
 Parsoid link trail escaping
 !! options
 parsoid=html2wt,html2html
-!! input
+!! wikitext
 [[apple]]<nowiki/>s
 [[apple]]<nowiki/>s
-!! result
+!! html
 <p><a rel="mw:WikiLink" href="Apple">apple</a>s</p>
 !! end
 
 <p><a rel="mw:WikiLink" href="Apple">apple</a>s</p>
 !! end
 
@@ -5656,15 +5596,15 @@ Parsoid link prefix escaping
 !! options
 language=is
 parsoid=html2wt,html2html
 !! options
 language=is
 parsoid=html2wt,html2html
-!! input
+!! wikitext
 Aðrir mótmælenda<nowiki/>[[söfnuður]]
 Aðrir mótmælenda<nowiki/>[[söfnuður]]
-!! result
+!! html
 <p>Aðrir mótmælenda<a rel="mw:WikiLink" href="Söfnuður">söfnuður</a></p>
 !! end
 
 !! test
 Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved
 <p>Aðrir mótmælenda<a rel="mw:WikiLink" href="Söfnuður">söfnuður</a></p>
 !! end
 
 !! test
 Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved
-!! input
+!! wikitext
 [[Foo|  bar]]
 
 [[Foo|  ''bar'']]
 [[Foo|  bar]]
 
 [[Foo|  ''bar'']]
@@ -5672,7 +5612,7 @@ Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved
 [http://wp.org   foo]
 
 [http://wp.org   ''foo'']
 [http://wp.org   foo]
 
 [http://wp.org   ''foo'']
-!! result
+!! html
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">  bar</a>
 </p><p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">  <i>bar</i></a>
 </p><p><a rel="nofollow" class="external text" href="http://wp.org">foo</a>
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">  bar</a>
 </p><p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">  <i>bar</i></a>
 </p><p><a rel="nofollow" class="external text" href="http://wp.org">foo</a>
@@ -5684,10 +5624,10 @@ Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved
 Parsoid: Scoped parsing should handle mixed transclusions and plain text
 !! options
 parsoid
 Parsoid: Scoped parsing should handle mixed transclusions and plain text
 !! options
 parsoid
-!! input
+!! wikitext
 [[Foo|{{echo|a}} b {{echo|c}}]]
 [[Foo|{{echo|a}} b {{echo|c}}]]
-!! result
-<p data-parsoid='{"dsr":[0,20,0,0]}'><a rel="mw:WikiLink" href="Foo"><span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a"}},"i":0}}]}'>a</span> b <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"c"}},"i":0}}]}'>c</span></a></p>
+!! html
+<p><a rel="mw:WikiLink" href="Foo"><span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a"}},"i":0}}]}'>a</span> b <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"c"}},"i":0}}]}'>c</span></a></p>
 !! end
 
 ###
 !! end
 
 ###
@@ -5696,28 +5636,28 @@ parsoid
 
 !! test
 Inline interwiki link
 
 !! test
 Inline interwiki link
-!! input
+!! wikitext
 [[MeatBall:SoftSecurity]]
 [[MeatBall:SoftSecurity]]
-!! result
+!! html
 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class="extiw" title="meatball:SoftSecurity">MeatBall:SoftSecurity</a>
 </p>
 !! end
 
 !! test
 Inline interwiki link with empty title (bug 2372)
 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class="extiw" title="meatball:SoftSecurity">MeatBall:SoftSecurity</a>
 </p>
 !! end
 
 !! test
 Inline interwiki link with empty title (bug 2372)
-!! input
+!! wikitext
 [[MeatBall:]]
 [[MeatBall:]]
-!! result
+!! html
 <p><a href="http://www.usemod.com/cgi-bin/mb.pl" class="extiw" title="meatball:">MeatBall:</a>
 </p>
 !! end
 
 !! test
 Interwiki link encoding conversion (bug 1636)
 <p><a href="http://www.usemod.com/cgi-bin/mb.pl" class="extiw" title="meatball:">MeatBall:</a>
 </p>
 !! end
 
 !! test
 Interwiki link encoding conversion (bug 1636)
-!! input
+!! wikitext
 *[[Wikipedia:ro:Olteni&#0355;a]]
 *[[Wikipedia:ro:Olteni&#355;a]]
 *[[Wikipedia:ro:Olteni&#0355;a]]
 *[[Wikipedia:ro:Olteni&#355;a]]
-!! result
+!! html
 <ul>
 <li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteni&#355;a</a>
 </li>
 <ul>
 <li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteni&#355;a</a>
 </li>
@@ -5729,9 +5669,9 @@ Interwiki link encoding conversion (bug 1636)
 
 !! test
 Interwiki link with fragment (bug 2130)
 
 !! test
 Interwiki link with fragment (bug 2130)
-!! input
+!! wikitext
 [[MeatBall:SoftSecurity#foo]]
 [[MeatBall:SoftSecurity#foo]]
-!! result
+!! html
 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity#foo" class="extiw" title="meatball:SoftSecurity">MeatBall:SoftSecurity#foo</a>
 </p>
 !! end
 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity#foo" class="extiw" title="meatball:SoftSecurity">MeatBall:SoftSecurity#foo</a>
 </p>
 !! end
@@ -5741,29 +5681,28 @@ Interwiki link with fragment (bug 2130)
 Different interwiki prefixes mapping to the same URL
 !! options
 parsoid
 Different interwiki prefixes mapping to the same URL
 !! options
 parsoid
-!! input
+!! wikitext
 [[wikipedia:Foo]]
 
 [[:en:Foo]]
 [[wikipedia:Foo]]
 
 [[:en:Foo]]
-!! result
-<p data-parsoid='{"dsr":[0,17,0,0]}'><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":"wikipedia:Foo"},"isIW":true,"dsr":[0,17,null,1]}'>wikipedia:Foo</a></p>
-
+!! html
+<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":"wikipedia:Foo"},"isIW":true}'>wikipedia:Foo</a></p>
 
 
-<p data-parsoid='{"dsr":[19,30,0,0]}'><a rel="mw:ExtLink" href="//en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"//en.wikipedia.org/wiki/Foo"},"sa":{"href":":en:Foo"},"isIW":true,"dsr":[19,30,null,1]}'>en:Foo</a></p>
+<p><a rel="mw:ExtLink" href="//en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"//en.wikipedia.org/wiki/Foo"},"sa":{"href":":en:Foo"},"isIW":true}'>en:Foo</a></p>
 !! end
 
 !! test
 Interwiki links that cannot be represented in wiki syntax
 !! options
 parsoid
 !! end
 
 !! test
 Interwiki links that cannot be represented in wiki syntax
 !! options
 parsoid
-!! input
+!! wikitext
 [[meatball:ok]]
 [[meatball:ok#foo|ok with fragment]]
 [[meatball:ok_as_well?|ok ending with ? mark]]
 [http://de.wikipedia.org/wiki/Foo?action=history has query]
 [http://de.wikipedia.org/wiki/#foo is just fragment]
 
 [[meatball:ok]]
 [[meatball:ok#foo|ok with fragment]]
 [[meatball:ok_as_well?|ok ending with ? mark]]
 [http://de.wikipedia.org/wiki/Foo?action=history has query]
 [http://de.wikipedia.org/wiki/#foo is just fragment]
 
-!! result
+!! html
 <p><a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok">meatball:ok</a>
 <a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok#foo">ok with fragment</a>
 <a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok_as_well%3F">ok ending with ? mark</a>
 <p><a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok">meatball:ok</a>
 <a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok#foo">ok with fragment</a>
 <a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok_as_well%3F">ok ending with ? mark</a>
@@ -5771,6 +5710,15 @@ parsoid
 <a rel="mw:ExtLink" href="http://de.wikipedia.org/wiki/#foo">is just fragment</a></p>
 !! end
 
 <a rel="mw:ExtLink" href="http://de.wikipedia.org/wiki/#foo">is just fragment</a></p>
 !! end
 
+!! test
+Interwiki links: trail
+!! options
+parsoid
+!! wikitext
+[[wikipedia:Foo|Ba]]r
+!! html
+<p data-parsoid='{}'><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"piped","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":"wikipedia:Foo"},"isIW":true,"tail":"r"}'>Bar</a></p>
+!! end
 
 ###
 ### Interlanguage links
 
 ###
 ### Interlanguage links
@@ -5779,21 +5727,21 @@ parsoid
 
 !! test
 Interlanguage link
 
 !! test
 Interlanguage link
-!! input
+!! wikitext
 Blah blah blah
 [[zh:Chinese]]
 Blah blah blah
 [[zh:Chinese]]
-!!result
+!! html
 <p>Blah blah blah
 </p>
 !! end
 
 !! test
 Double interlanguage link
 <p>Blah blah blah
 </p>
 !! end
 
 !! test
 Double interlanguage link
-!! input
+!! wikitext
 Blah blah blah
 [[es:Spanish]]
 [[zh:Chinese]]
 Blah blah blah
 [[es:Spanish]]
 [[zh:Chinese]]
-!!result
+!! html
 <p>Blah blah blah
 </p>
 !! end
 <p>Blah blah blah
 </p>
 !! end
@@ -5802,10 +5750,10 @@ Blah blah blah
 Interlanguage link, with prefix links
 !! options
 language=ln
 Interlanguage link, with prefix links
 !! options
 language=ln
-!! input
+!! wikitext
 Blah blah blah
 [[zh:Chinese]]
 Blah blah blah
 [[zh:Chinese]]
-!!result
+!! html
 <p>Blah blah blah
 </p>
 !! end
 <p>Blah blah blah
 </p>
 !! end
@@ -5814,11 +5762,11 @@ Blah blah blah
 Double interlanguage link, with prefix links (bug 8897)
 !! options
 language=ln
 Double interlanguage link, with prefix links (bug 8897)
 !! options
 language=ln
-!! input
+!! wikitext
 Blah blah blah
 [[es:Spanish]]
 [[zh:Chinese]]
 Blah blah blah
 [[es:Spanish]]
 [[zh:Chinese]]
-!!result
+!! html
 <p>Blah blah blah
 </p>
 !! end
 <p>Blah blah blah
 </p>
 !! end
@@ -5827,9 +5775,9 @@ Blah blah blah
 Parsoid-specific test: Wikilinks with &nbsp; should RT properly
 !! options
 language=ln
 Parsoid-specific test: Wikilinks with &nbsp; should RT properly
 !! options
 language=ln
-!! input
+!! wikitext
 [[WW&nbsp;II]]
 [[WW&nbsp;II]]
-!!result
+!! html
 <p><a href="/index.php?title=WW_II&amp;action=edit&amp;redlink=1" class="new" title="WW II (lonkásá  ezalí tɛ̂)">WW&#160;II</a>
 </p>
 !! end
 <p><a href="/index.php?title=WW_II&amp;action=edit&amp;redlink=1" class="new" title="WW II (lonkásá  ezalí tɛ̂)">WW&#160;II</a>
 </p>
 !! end
@@ -5838,11 +5786,11 @@ language=ln
 Parsoid bug 53221: Wikilinks should be properly entity-escaped
 !! options
 parsoid=html2wt
 Parsoid bug 53221: Wikilinks should be properly entity-escaped
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 He&amp;nbsp;llo [[Foo|He&amp;nbsp;llo]]
 
 He&amp;nbsp;llo [[He&amp;nbsp;llo]]
 He&amp;nbsp;llo [[Foo|He&amp;nbsp;llo]]
 
 He&amp;nbsp;llo [[He&amp;nbsp;llo]]
-!!result
+!! html
 <p>He&amp;nbsp;llo <a href="Foo" rel="mw:WikiLink">He&amp;nbsp;llo</a></p>
 <p>He&amp;nbsp;llo <a href="He&amp;nbsp;llo" rel="mw:WikiLink">He&amp;nbsp;llo</a></p>
 !! end
 <p>He&amp;nbsp;llo <a href="Foo" rel="mw:WikiLink">He&amp;nbsp;llo</a></p>
 <p>He&amp;nbsp;llo <a href="He&amp;nbsp;llo" rel="mw:WikiLink">He&amp;nbsp;llo</a></p>
 !! end
@@ -5851,24 +5799,23 @@ He&amp;nbsp;llo [[He&amp;nbsp;llo]]
 Parsoid: handle constructor well
 !! options
 parsoid
 Parsoid: handle constructor well
 !! options
 parsoid
-!! input
+!! wikitext
 [[constructor]]
 
 [[constructor:foo]]
 [[constructor]]
 
 [[constructor:foo]]
-!! result
-<p data-parsoid="{&quot;dsr&quot;:[0,15,0,0]}"><a rel="mw:WikiLink" href="./Constructor" data-parsoid="{&quot;stx&quot;:&quot;simple&quot;,&quot;a&quot;:{&quot;href&quot;:&quot;./Constructor&quot;},&quot;sa&quot;:{&quot;href&quot;:&quot;constructor&quot;},&quot;dsr&quot;:[0,15,2,2]}">constructor</a></p>
+!! html
+<p><a rel="mw:WikiLink" href="./Constructor" data-parsoid="{&quot;stx&quot;:&quot;simple&quot;,&quot;a&quot;:{&quot;href&quot;:&quot;./Constructor&quot;},&quot;sa&quot;:{&quot;href&quot;:&quot;constructor&quot;}}">constructor</a></p>
 
 
-
-<p data-parsoid="{&quot;dsr&quot;:[17,36,0,0]}"><a rel="mw:WikiLink" href="./Foo" data-parsoid="{&quot;stx&quot;:&quot;simple&quot;,&quot;a&quot;:{&quot;href&quot;:&quot;./Foo&quot;},&quot;sa&quot;:{&quot;href&quot;:&quot;constructor:foo&quot;},&quot;dsr&quot;:[17,36,2,2]}">constructor:foo</a></p>
+<p><a rel="mw:WikiLink" href="./Foo" data-parsoid="{&quot;stx&quot;:&quot;simple&quot;,&quot;a&quot;:{&quot;href&quot;:&quot;./Foo&quot;},&quot;sa&quot;:{&quot;href&quot;:&quot;constructor:foo&quot;}}">constructor:foo</a></p>
 !! end
 
 !! test
 Parsoid: recognize interlanguage links without a target page
 !! options
 parsoid
 !! end
 
 !! test
 Parsoid: recognize interlanguage links without a target page
 !! options
 parsoid
-!! input
+!! wikitext
 [[ko:]]
 [[ko:]]
-!! result
+!! html
 <p>
 <link rel="mw:PageProp/Language" href="http://ko.wikipedia.org/wiki/"></p>
 !! end
 <p>
 <link rel="mw:PageProp/Language" href="http://ko.wikipedia.org/wiki/"></p>
 !! end
@@ -5877,34 +5824,57 @@ parsoid
 Parsoid: recognize interwiki links without a target page
 !! options
 parsoid
 Parsoid: recognize interwiki links without a target page
 !! options
 parsoid
-!! input
+!! wikitext
 [[:ko:]]
 [[:ko:]]
-!! result
+!! html
 <p><a rel="mw:ExtLink" href="//ko.wikipedia.org/wiki/">ko:</a></p>
 !! end
 
 <p><a rel="mw:ExtLink" href="//ko.wikipedia.org/wiki/">ko:</a></p>
 !! end
 
+!! test
+Parsoid: Bug #45209, handle interwiki links pointing to the current wiki as plain wiki links
+!! options
+parsoid
+!! wikitext
+[[en:Foo]]
+!! html
+<p><a rel="mw:WikiLink" href="./Foo" data-parsoid='{"stx":"simple","a":{"href":"./Foo"},"sa":{"href":"en:Foo"}}'>Foo</a></p>
+!! end
+
 ###
 ### Redirects, Parsoid-only
 ###
 !! test
 ###
 ### Redirects, Parsoid-only
 ###
 !! test
-Simple redirect to page
+1. Simple redirect to page
 !! options
 parsoid
 !! options
 parsoid
-!! input
+!! wikitext
 #REDIRECT [[Main Page]]
 #REDIRECT [[Main Page]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="./Main_Page">
 !! end
 
 <link rel="mw:PageProp/redirect" href="./Main_Page">
 !! end
 
+# Only wt2html and html2html since "Main_Page" will serialize to "Main Page"
+!! test
+2. Other redirect variants
+!! options
+parsoid=wt2html,wt2wt
+!! wikitext
+#REDIRECT [[Main_Page]]
+#REDIRECT [[<nowiki>[[Bar]]</nowiki>]]
+!! html
+<link rel="mw:PageProp/redirect" href="./Main_Page">
+<link rel="mw:PageProp/redirect" href="./%5B%5BBar%5D%5D">
+!! end
+
 !! test
 Optional colon in #REDIRECT
 !! options
 # the colon is archaic syntax.  we support it for wt2html, but we
 # don't care that it roundtrips back to the modern syntax.
 parsoid=wt2html,html2html
 !! test
 Optional colon in #REDIRECT
 !! options
 # the colon is archaic syntax.  we support it for wt2html, but we
 # don't care that it roundtrips back to the modern syntax.
 parsoid=wt2html,html2html
-!! input
+!! wikitext
 #REDIRECT:[[Main Page]]
 #REDIRECT:[[Main Page]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="./Main_Page">
 !! end
 
 <link rel="mw:PageProp/redirect" href="./Main_Page">
 !! end
 
@@ -5915,12 +5885,12 @@ Whitespace in #REDIRECT with optional colon
 # it for wt2html, but we don't care that it roundtrips back to the
 # modern syntax (without extra whitespace)
 parsoid=wt2html,html2html
 # it for wt2html, but we don't care that it roundtrips back to the
 # modern syntax (without extra whitespace)
 parsoid=wt2html,html2html
-!! input
+!! wikitext
  
  #REDIRECT 
 : 
 [[Main Page]]
  
  #REDIRECT 
 : 
 [[Main Page]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="./Main_Page">
 !! end
 
 <link rel="mw:PageProp/redirect" href="./Main_Page">
 !! end
 
@@ -5930,9 +5900,9 @@ Piped link in #REDIRECT
 # content after piped link is ignored.  we support this syntax,
 # but don't care that the piped link is lost when we roundtrip this.
 parsoid=wt2html
 # content after piped link is ignored.  we support this syntax,
 # but don't care that the piped link is lost when we roundtrip this.
 parsoid=wt2html
-!! input
+!! wikitext
 #REDIRECT [[Main Page|bar]]
 #REDIRECT [[Main Page|bar]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="./Main_Page">
 !! end
 
 <link rel="mw:PageProp/redirect" href="./Main_Page">
 !! end
 
@@ -5940,9 +5910,9 @@ parsoid=wt2html
 Redirect to category
 !! options
 parsoid=wt2html
 Redirect to category
 !! options
 parsoid=wt2html
-!! input
+!! wikitext
 #REDIRECT [[Category:Foo]]
 #REDIRECT [[Category:Foo]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="./Category:Foo"><link rel="mw:PageProp/Category" href="./Category:Foo">
 !! end
 
 <link rel="mw:PageProp/redirect" href="./Category:Foo"><link rel="mw:PageProp/Category" href="./Category:Foo">
 !! end
 
@@ -5950,9 +5920,9 @@ parsoid=wt2html
 Redirect to category with URL encoding
 !! options
 parsoid=wt2html
 Redirect to category with URL encoding
 !! options
 parsoid=wt2html
-!! input
+!! wikitext
 #REDIRECT [[Category%3AFoo]]
 #REDIRECT [[Category%3AFoo]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="./Category:Foo"><link rel="mw:PageProp/Category" href="./Category:Foo">
 !! end
 
 <link rel="mw:PageProp/redirect" href="./Category:Foo"><link rel="mw:PageProp/Category" href="./Category:Foo">
 !! end
 
@@ -5960,9 +5930,9 @@ parsoid=wt2html
 Redirect to category page
 !! options
 parsoid=wt2html,html2html
 Redirect to category page
 !! options
 parsoid=wt2html,html2html
-!! input
+!! wikitext
 #REDIRECT [[:Category:Foo]]
 #REDIRECT [[:Category:Foo]]
-!! result
+!! html
 <p><a rel="mw:WikiLink" href="Category:Foo">Category:Foo</a></p>
 !! end
 
 <p><a rel="mw:WikiLink" href="Category:Foo">Category:Foo</a></p>
 !! end
 
@@ -5970,9 +5940,9 @@ parsoid=wt2html,html2html
 Redirect to image page (1)
 !! options
 parsoid
 Redirect to image page (1)
 !! options
 parsoid
-!! input
+!! wikitext
 #REDIRECT [[File:Wiki.png]]
 #REDIRECT [[File:Wiki.png]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="./File:Wiki.png">
 !! end
 
 <link rel="mw:PageProp/redirect" href="./File:Wiki.png">
 !! end
 
@@ -5980,9 +5950,9 @@ parsoid
 Redirect to image page (2)
 !! options
 parsoid
 Redirect to image page (2)
 !! options
 parsoid
-!! input
+!! wikitext
 #REDIRECT [[Image:Wiki.png]]
 #REDIRECT [[Image:Wiki.png]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="./File:Wiki.png">
 !! end
 
 <link rel="mw:PageProp/redirect" href="./File:Wiki.png">
 !! end
 
@@ -5990,9 +5960,9 @@ parsoid
 Redirect to language
 !! options
 parsoid
 Redirect to language
 !! options
 parsoid
-!! input
+!! wikitext
 #REDIRECT [[en:File:Wiki.png]]
 #REDIRECT [[en:File:Wiki.png]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="File:Wiki.png">
 !! end
 
 <link rel="mw:PageProp/redirect" href="File:Wiki.png">
 !! end
 
@@ -6000,9 +5970,9 @@ parsoid
 Redirect to interwiki
 !! options
 parsoid
 Redirect to interwiki
 !! options
 parsoid
-!! input
+!! wikitext
 #REDIRECT [[meatball:File:Wiki.png]]
 #REDIRECT [[meatball:File:Wiki.png]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="File:Wiki.png">
 !! end
 
 <link rel="mw:PageProp/redirect" href="File:Wiki.png">
 !! end
 
@@ -6011,32 +5981,41 @@ Non-English #REDIRECT
 !! options
 parsoid
 language=is
 !! options
 parsoid
 language=is
-!! input
+!! wikitext
 #TILVÍSUN [[Main Page]]
 #TILVÍSUN [[Main Page]]
-!! result
+!! html
 <link rel="mw:PageProp/redirect" href="./Main_Page">
 !! end
 
 <link rel="mw:PageProp/redirect" href="./Main_Page">
 !! end
 
+!! test
+New redirect
+!! options
+parsoid=html2wt
+!! wikitext
+Foo
+#REDIRECT [[Foo]]
+!! html
+<p>Foo<link rel="mw:PageProp/redirect" href="./Foo"></p>
+!! end
+
 ##
 ## XHTML tidiness
 ###
 
 !! test
 <br> to <br />
 ##
 ## XHTML tidiness
 ###
 
 !! test
 <br> to <br />
-!! input
+!! wikitext
 1<br>2<br />3
 1<br>2<br />3
-!! result
+!! html
 <p>1<br />2<br />3
 </p>
 !! end
 
 !! test
 Broken br tag sanitization
 <p>1<br />2<br />3
 </p>
 !! end
 
 !! test
 Broken br tag sanitization
-!! options
-php
-!! input
+!! wikitext
 </br>
 </br>
-!! result
+!! html/php
 <p>&lt;/br&gt;
 </p>
 !! end
 <p>&lt;/br&gt;
 </p>
 !! end
@@ -6046,28 +6025,28 @@ php
 Parsoid: Broken br tag recognition
 !! options
 parsoid=wt2html
 Parsoid: Broken br tag recognition
 !! options
 parsoid=wt2html
-!! input
+!! wikitext
 </br>
 </br>
-!! result
+!! html/parsoid
 <p><br></p>
 !! end
 
 !! test
 Incorrecly removing closing slashes from correctly formed XHTML
 <p><br></p>
 !! end
 
 !! test
 Incorrecly removing closing slashes from correctly formed XHTML
-!! input
+!! wikitext
 <br style="clear:both;" />
 <br style="clear:both;" />
-!! result
+!! html
 <p><br style="clear:both;" />
 </p>
 !! end
 
 !! test
 Failing to transform badly formed HTML into correct XHTML
 <p><br style="clear:both;" />
 </p>
 !! end
 
 !! test
 Failing to transform badly formed HTML into correct XHTML
-!! input
+!! wikitext
 <br style="clear: left;">
 <br style="clear: right;">
 <br style="clear: both;">
 <br style="clear: left;">
 <br style="clear: right;">
 <br style="clear: both;">
-!! result
+!! html
 <p><br style="clear: left;" />
 <br style="clear: right;" />
 <br style="clear: both;" />
 <p><br style="clear: left;" />
 <br style="clear: right;" />
 <br style="clear: both;" />
@@ -6076,14 +6055,14 @@ Failing to transform badly formed HTML into correct XHTML
 
 !! test
 Handling html with a div self-closing tag
 
 !! test
 Handling html with a div self-closing tag
-!! input
+!! wikitext
 <div title />
 <div title/>
 <div title/ >
 <div title=bar />
 <div title=bar/>
 <div title=bar/ >
 <div title />
 <div title/>
 <div title/ >
 <div title=bar />
 <div title=bar/>
 <div title=bar/ >
-!! result
+!! html
 <p>&lt;div title /&gt;
 &lt;div title/&gt;
 </p>
 <p>&lt;div title /&gt;
 &lt;div title/&gt;
 </p>
@@ -6098,14 +6077,14 @@ Handling html with a div self-closing tag
 
 !! test
 Handling html with a br self-closing tag
 
 !! test
 Handling html with a br self-closing tag
-!! input
+!! wikitext
 <br title />
 <br title/>
 <br title/ >
 <br title=bar />
 <br title=bar/>
 <br title=bar/ >
 <br title />
 <br title/>
 <br title/ >
 <br title=bar />
 <br title=bar/>
 <br title=bar/ >
-!! result
+!! html
 <p><br title="title" />
 <br title="title" />
 <br />
 <p><br title="title" />
 <br title="title" />
 <br />
@@ -6117,12 +6096,12 @@ Handling html with a br self-closing tag
 
 !! test
 Horizontal ruler (should it add that extra space?)
 
 !! test
 Horizontal ruler (should it add that extra space?)
-!! input
+!! wikitext
 <hr>
 <hr >
 foo <hr
 > bar
 <hr>
 <hr >
 foo <hr
 > bar
-!! result
+!! html
 <hr />
 <hr />
 foo <hr /> bar
 <hr />
 <hr />
 foo <hr /> bar
@@ -6131,28 +6110,28 @@ foo <hr /> bar
 
 !! test
 Horizontal ruler -- 4+ dashes render hr
 
 !! test
 Horizontal ruler -- 4+ dashes render hr
-!! input
+!! wikitext
 ----
 ----
-!! result
+!! html
 <hr />
 
 !! end
 
 !! test
 Horizontal ruler -- eats additional dashes on the same line
 <hr />
 
 !! end
 
 !! test
 Horizontal ruler -- eats additional dashes on the same line
-!! input
+!! wikitext
 ---------
 ---------
-!! result
+!! html
 <hr />
 
 !! end
 
 !! test
 Horizontal ruler -- does not collapse dashes on consecutive lines
 <hr />
 
 !! end
 
 !! test
 Horizontal ruler -- does not collapse dashes on consecutive lines
-!! input
+!! wikitext
 ----
 ----
 ----
 ----
-!! result
+!! html
 <hr />
 <hr />
 
 <hr />
 <hr />
 
@@ -6160,18 +6139,18 @@ Horizontal ruler -- does not collapse dashes on consecutive lines
 
 !! test
 Horizontal ruler -- <4 dashes render as plain text
 
 !! test
 Horizontal ruler -- <4 dashes render as plain text
-!! input
+!! wikitext
 ---
 ---
-!! result
+!! html
 <p>---
 </p>
 !! end
 
 !! test
 Horizontal ruler -- Supports content following dashes on same line
 <p>---
 </p>
 !! end
 
 !! test
 Horizontal ruler -- Supports content following dashes on same line
-!! input
+!! wikitext
 ---- Foo
 ---- Foo
-!! result
+!! html
 <hr /> Foo
 
 !! end
 <hr /> Foo
 
 !! end
@@ -6181,11 +6160,11 @@ Horizontal ruler -- Supports content following dashes on same line
 ###
 !! test
 Common list
 ###
 !! test
 Common list
-!! input
+!! wikitext
 *Common list
 * item 2
 *item 3
 *Common list
 * item 2
 *item 3
-!! result
+!! html
 <ul>
 <li>Common list
 </li>
 <ul>
 <li>Common list
 </li>
@@ -6199,11 +6178,11 @@ Common list
 
 !! test
 Numbered list
 
 !! test
 Numbered list
-!! input
+!! wikitext
 #Numbered list
 #item 2
 # item 3
 #Numbered list
 #item 2
 # item 3
-!! result
+!! html
 <ol>
 <li>Numbered list
 </li>
 <ol>
 <li>Numbered list
 </li>
@@ -6217,7 +6196,7 @@ Numbered list
 
 !! test
 Mixed list
 
 !! test
 Mixed list
-!! input
+!! wikitext
 *Mixed list
 *# with numbers
 ** and bullets
 *Mixed list
 *# with numbers
 ** and bullets
@@ -6233,7 +6212,7 @@ Mixed list
 *Level 1
 *** Level 3
 #** Level 3, but ordered
 *Level 1
 *** Level 3
 #** Level 3, but ordered
-!! result
+!! html
 <ul>
 <li>Mixed list
 <ol>
 <ul>
 <li>Mixed list
 <ol>
@@ -6300,10 +6279,10 @@ Mixed list
 
 !! test
 Nested lists 1
 
 !! test
 Nested lists 1
-!! input
+!! wikitext
 *foo
 **bar
 *foo
 **bar
-!! result
+!! html
 <ul>
 <li>foo
 <ul>
 <ul>
 <li>foo
 <ul>
@@ -6317,10 +6296,10 @@ Nested lists 1
 
 !! test
 Nested lists 2
 
 !! test
 Nested lists 2
-!! input
+!! wikitext
 **foo
 *bar
 **foo
 *bar
-!! result
+!! html
 <ul>
 <li><ul>
 <li>foo
 <ul>
 <li><ul>
 <li>foo
@@ -6335,10 +6314,10 @@ Nested lists 2
 
 !! test
 Nested lists 3 (first element empty)
 
 !! test
 Nested lists 3 (first element empty)
-!! input
+!! wikitext
 *
 **bar
 *
 **bar
-!! result
+!! html
 <ul>
 <li>
 <ul>
 <ul>
 <li>
 <ul>
@@ -6352,10 +6331,10 @@ Nested lists 3 (first element empty)
 
 !! test
 Nested lists 4 (first element empty)
 
 !! test
 Nested lists 4 (first element empty)
-!! input
+!! wikitext
 **
 *bar
 **
 *bar
-!! result
+!! html
 <ul>
 <li><ul>
 <li>
 <ul>
 <li><ul>
 <li>
@@ -6370,10 +6349,10 @@ Nested lists 4 (first element empty)
 
 !! test
 Nested lists 5 (both elements empty)
 
 !! test
 Nested lists 5 (both elements empty)
-!! input
+!! wikitext
 **
 *
 **
 *
-!! result
+!! html
 <ul>
 <li><ul>
 <li>
 <ul>
 <li><ul>
 <li>
@@ -6388,10 +6367,10 @@ Nested lists 5 (both elements empty)
 
 !! test
 Nested lists 6 (both elements empty)
 
 !! test
 Nested lists 6 (both elements empty)
-!! input
+!! wikitext
 *
 **
 *
 **
-!! result
+!! html
 <ul>
 <li>
 <ul>
 <ul>
 <li>
 <ul>
@@ -6405,9 +6384,9 @@ Nested lists 6 (both elements empty)
 
 !! test
 Nested lists 7 (skip initial nesting levels)
 
 !! test
 Nested lists 7 (skip initial nesting levels)
-!! input
+!! wikitext
 *** foo
 *** foo
-!! result
+!! html
 <ul>
 <li><ul>
 <li><ul>
 <ul>
 <li><ul>
 <li><ul>
@@ -6423,12 +6402,12 @@ Nested lists 7 (skip initial nesting levels)
 
 !! test
 Nested lists 8 (multiple nesting transitions)
 
 !! test
 Nested lists 8 (multiple nesting transitions)
-!! input
+!! wikitext
 * foo
 *** bar
 ** baz
 * boo
 * foo
 *** bar
 ** baz
 * boo
-!! result
+!! html
 <ul>
 <li> foo
 <ul>
 <ul>
 <li> foo
 <ul>
@@ -6449,11 +6428,11 @@ Nested lists 8 (multiple nesting transitions)
 
 !! test
 1. Lists with start-of-line-transparent tokens before bullets: Comments
 
 !! test
 1. Lists with start-of-line-transparent tokens before bullets: Comments
-!! input
+!! wikitext
 *foo
 *<!--cmt-->bar
 <!--cmt-->*baz
 *foo
 *<!--cmt-->bar
 <!--cmt-->*baz
-!! result
+!! html
 <ul>
 <li>foo
 </li>
 <ul>
 <li>foo
 </li>
@@ -6467,10 +6446,10 @@ Nested lists 8 (multiple nesting transitions)
 
 !! test
 2. Lists with start-of-line-transparent tokens before bullets: Template close
 
 !! test
 2. Lists with start-of-line-transparent tokens before bullets: Template close
-!! input
+!! wikitext
 *foo {{echo|bar
 }}*baz
 *foo {{echo|bar
 }}*baz
-!! result
+!! html
 <ul>
 <li>foo bar
 </li>
 <ul>
 <li>foo bar
 </li>
@@ -6482,11 +6461,11 @@ Nested lists 8 (multiple nesting transitions)
 
 !! test
 List items are not parsed correctly following a <pre> block (bug 785)
 
 !! test
 List items are not parsed correctly following a <pre> block (bug 785)
-!! input
+!! wikitext
 * <pre>foo</pre>
 * <pre>bar</pre>
 * zar
 * <pre>foo</pre>
 * <pre>bar</pre>
 * zar
-!! result
+!! html
 <ul>
 <li> <pre>foo</pre>
 </li>
 <ul>
 <li> <pre>foo</pre>
 </li>
@@ -6500,7 +6479,7 @@ List items are not parsed correctly following a <pre> block (bug 785)
 
 !! test
 List items from template
 
 !! test
 List items from template
-!! input
+!! wikitext
 
 {{inner list}}
 * item 2
 
 {{inner list}}
 * item 2
@@ -6512,7 +6491,7 @@ List items from template
 * item 0
 * notSOL{{inner list}}
 * item 2
 * item 0
 * notSOL{{inner list}}
 * item 2
-!! result
+!! html
 <ul>
 <li> item 1
 </li>
 <ul>
 <li> item 1
 </li>
@@ -6542,13 +6521,13 @@ List items from template
 
 !! test
 List interrupted by empty line or heading
 
 !! test
 List interrupted by empty line or heading
-!! input
+!! wikitext
 * foo
 
 ** bar
 == A heading ==
 * Another list item
 * foo
 
 ** bar
 == A heading ==
 * Another list item
-!! result
+!! html
 <ul>
 <li> foo
 </li>
 <ul>
 <li> foo
 </li>
@@ -6570,11 +6549,11 @@ List interrupted by empty line or heading
 
 !!test
 Multiple list tags generated by templates
 
 !!test
 Multiple list tags generated by templates
-!!input
+!! wikitext
 {{echo|<li>}}a
 {{echo|<li>}}b
 {{echo|<li>}}c
 {{echo|<li>}}a
 {{echo|<li>}}b
 {{echo|<li>}}c
-!!result
+!! html
 <li>a
 <li>b
 <li>c</li>
 <li>a
 <li>b
 <li>c</li>
@@ -6585,7 +6564,7 @@ Multiple list tags generated by templates
 
 !!test
 Single-comment whitespace lines dont break lists, and neither do multi-comment whitespace lines
 
 !!test
 Single-comment whitespace lines dont break lists, and neither do multi-comment whitespace lines
-!!input
+!! wikitext
 *a
 <!--This line will NOT split the list-->
 *b
 *a
 <!--This line will NOT split the list-->
 *b
@@ -6593,7 +6572,7 @@ Single-comment whitespace lines dont break lists, and neither do multi-comment w
 *c
  <!--foo--> <!----> <!--This line NOT split the list either--> 
 *d
 *c
  <!--foo--> <!----> <!--This line NOT split the list either--> 
 *d
-!!result
+!! html
 <ul>
 <li>a
 </li>
 <ul>
 <li>a
 </li>
@@ -6609,7 +6588,7 @@ Single-comment whitespace lines dont break lists, and neither do multi-comment w
 
 !!test
 Replacing whitespace with tabs still doesn't break the list (gerrit 78327)
 
 !!test
 Replacing whitespace with tabs still doesn't break the list (gerrit 78327)
-!!input
+!! wikitext
 *a
 <!--This line will NOT split the list-->       
 *b
 *a
 <!--This line will NOT split the list-->       
 *b
@@ -6618,7 +6597,7 @@ Replacing whitespace with tabs still doesn't break the list (gerrit 78327)
        <!--foo--> <!---->      <!--This line NOT split the list
         either-->       
 *d
        <!--foo--> <!---->      <!--This line NOT split the list
         either-->       
 *d
-!!result
+!! html
 <ul>
 <li>a
 </li>
 <ul>
 <li>a
 </li>
@@ -6637,7 +6616,7 @@ Test the li-hack
 (Cannot test this with PHP parser since it relies on Tidy for the hack)
 !!options
 parsoid=wt2html,wt2wt
 (Cannot test this with PHP parser since it relies on Tidy for the hack)
 !!options
 parsoid=wt2html,wt2wt
-!!input
+!! wikitext
 * foo
 * <li>li-hack
 * {{echo|<li>templated li-hack}}
 * foo
 * <li>li-hack
 * {{echo|<li>templated li-hack}}
@@ -6647,7 +6626,7 @@ parsoid=wt2html,wt2wt
 <li><li>not a li-hack
 </li>
 </ul>
 <li><li>not a li-hack
 </li>
 </ul>
-!!result
+!! html
 <ul>
 <li> foo</li>
 <li>li-hack</li>
 <ul>
 <li> foo</li>
 <li>li-hack</li>
@@ -6667,14 +6646,14 @@ parsoid=wt2html,wt2wt
 Parsoid: Make sure nested lists are serialized on their own line even if HTML contains no newlines
 !! options
 parsoid
 Parsoid: Make sure nested lists are serialized on their own line even if HTML contains no newlines
 !! options
 parsoid
-!! input
+!! wikitext
 # foo
 ## bar
 * foo
 ** bar
 : foo
 :: bar
 # foo
 ## bar
 * foo
 ** bar
 : foo
 :: bar
-!! result
+!! html
 <ol>
 <li> foo<ol>
 <li> bar</li>
 <ol>
 <li> foo<ol>
 <li> bar</li>
@@ -6694,9 +6673,9 @@ parsoid
 Parsoid: Test of whitespace serialization with Templated bullets
 !! options
 parsoid
 Parsoid: Test of whitespace serialization with Templated bullets
 !! options
 parsoid
-!! input
+!! wikitext
 * {{bullet}}
 * {{bullet}}
-!! result
+!! html
 <ul>
 <li> </li><li about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"bullet","href":"./Template:Bullet"},"params":{},"i":0}}]}'> Bar</li>
 </ul>
 <ul>
 <li> </li><li about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"bullet","href":"./Template:Bullet"},"params":{},"i":0}}]}'> Bar</li>
 </ul>
@@ -6710,13 +6689,11 @@ parsoid
 !! test
 Unbalanced closing block tags break a list
 (Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
 !! test
 Unbalanced closing block tags break a list
 (Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
-!! options
-parsoid
-!! input
+!! wikitext
 <div>
 *a</div><div>
 *b</div>
 <div>
 *a</div><div>
 *b</div>
-!! result
+!! html/parsoid
 <div>
 <ul>
 <li>a
 <div>
 <ul>
 <li>a
@@ -6731,13 +6708,11 @@ parsoid
 !! test
 Unbalanced closing non-block tags don't break a list
 (Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
 !! test
 Unbalanced closing non-block tags don't break a list
 (Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
-!! options
-parsoid
-!! input
+!! wikitext
 <span>
 *a</span><span>
 *b</span>
 <span>
 *a</span><span>
 *b</span>
-!! result
+!! html/parsoid
 <p><span></span>
 </p>
 <ul>
 <p><span></span>
 </p>
 <ul>
@@ -6751,12 +6726,10 @@ parsoid
 !! test
 Unclosed formatting tags that straddle lists are closed and reopened
 (Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
 !! test
 Unclosed formatting tags that straddle lists are closed and reopened
 (Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
-!! options
-parsoid
-!! input
+!! wikitext
 # <s> a
 # b </s>
 # <s> a
 # b </s>
-!! result
+!! html/parsoid
 <ol>
 <li> <s> a </s>
 </li>
 <ol>
 <li> <s> a </s>
 </li>
@@ -6768,13 +6741,11 @@ parsoid
 !!test
 List embedded in a non-block tag
 (Ugly Parsoid output -- worth fixing; Disabled for PHP parser since it relies on Tidy)
 !!test
 List embedded in a non-block tag
 (Ugly Parsoid output -- worth fixing; Disabled for PHP parser since it relies on Tidy)
-!! options
-parsoid
-!!input
+!! wikitext
 <small>
 * foo
 </small>
 <small>
 * foo
 </small>
-!!result
+!! html/parsoid
 <p><small></small></p>
 <small>
 <ul>
 <p><small></small></p>
 <small>
 <ul>
@@ -6788,12 +6759,12 @@ parsoid
 Table with missing opening <tr> tag
 !! options
 parsoid=wt2html,wt2wt
 Table with missing opening <tr> tag
 !! options
 parsoid=wt2html,wt2wt
-!! input
+!! wikitext
 <table>
 <td>foo</td>
 </tr>
 </table>
 <table>
 <td>foo</td>
 </tr>
 </table>
-!! result
+!! html/parsoid
 <table>
 <tr>
 <td>foo</td>
 <table>
 <tr>
 <td>foo</td>
@@ -6812,133 +6783,133 @@ parsoid=wt2html,wt2wt
 
 !! test
 Magic Word: {{CURRENTDAY}}
 
 !! test
 Magic Word: {{CURRENTDAY}}
-!! input
+!! wikitext
 {{CURRENTDAY}}
 {{CURRENTDAY}}
-!! result
+!! html
 <p>1
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTDAY2}}
 <p>1
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTDAY2}}
-!! input
+!! wikitext
 {{CURRENTDAY2}}
 {{CURRENTDAY2}}
-!! result
+!! html
 <p>01
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTDAYNAME}}
 <p>01
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTDAYNAME}}
-!! input
+!! wikitext
 {{CURRENTDAYNAME}}
 {{CURRENTDAYNAME}}
-!! result
+!! html
 <p>Thursday
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTDOW}}
 <p>Thursday
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTDOW}}
-!! input
+!! wikitext
 {{CURRENTDOW}}
 {{CURRENTDOW}}
-!! result
+!! html
 <p>4
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTMONTH}}
 <p>4
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTMONTH}}
-!! input
+!! wikitext
 {{CURRENTMONTH}}
 {{CURRENTMONTH}}
-!! result
+!! html
 <p>01
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTMONTH1}}
 <p>01
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTMONTH1}}
-!! input
+!! wikitext
 {{CURRENTMONTH1}}
 {{CURRENTMONTH1}}
-!! result
+!! html
 <p>1
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTMONTHABBREV}}
 <p>1
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTMONTHABBREV}}
-!! input
+!! wikitext
 {{CURRENTMONTHABBREV}}
 {{CURRENTMONTHABBREV}}
-!! result
+!! html
 <p>Jan
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTMONTHNAME}}
 <p>Jan
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTMONTHNAME}}
-!! input
+!! wikitext
 {{CURRENTMONTHNAME}}
 {{CURRENTMONTHNAME}}
-!! result
+!! html
 <p>January
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTMONTHNAMEGEN}}
 <p>January
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTMONTHNAMEGEN}}
-!! input
+!! wikitext
 {{CURRENTMONTHNAMEGEN}}
 {{CURRENTMONTHNAMEGEN}}
-!! result
+!! html
 <p>January
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTTIME}}
 <p>January
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTTIME}}
-!! input
+!! wikitext
 {{CURRENTTIME}}
 {{CURRENTTIME}}
-!! result
+!! html
 <p>00:02
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTHOUR}}
 <p>00:02
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTHOUR}}
-!! input
+!! wikitext
 {{CURRENTHOUR}}
 {{CURRENTHOUR}}
-!! result
+!! html
 <p>00
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTWEEK}} (@bug 4594)
 <p>00
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTWEEK}} (@bug 4594)
-!! input
+!! wikitext
 {{CURRENTWEEK}}
 {{CURRENTWEEK}}
-!! result
+!! html
 <p>1
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTYEAR}}
 <p>1
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTYEAR}}
-!! input
+!! wikitext
 {{CURRENTYEAR}}
 {{CURRENTYEAR}}
-!! result
+!! html
 <p>1970
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTTIMESTAMP}}
 <p>1970
 </p>
 !! end
 
 !! test
 Magic Word: {{CURRENTTIMESTAMP}}
-!! input
+!! wikitext
 {{CURRENTTIMESTAMP}}
 {{CURRENTTIMESTAMP}}
-!! result
+!! html
 <p>19700101000203
 </p>
 !! end
 
 !! test
 Magic Words LOCAL (UTC)
 <p>19700101000203
 </p>
 !! end
 
 !! test
 Magic Words LOCAL (UTC)
-!! input
+!! wikitext
 * {{LOCALMONTH}}
 * {{LOCALMONTH1}}
 * {{LOCALMONTHNAME}}
 * {{LOCALMONTH}}
 * {{LOCALMONTH1}}
 * {{LOCALMONTHNAME}}
@@ -6953,7 +6924,7 @@ Magic Words LOCAL (UTC)
 * {{LOCALWEEK}}
 * {{LOCALDOW}}
 * {{LOCALTIMESTAMP}}
 * {{LOCALWEEK}}
 * {{LOCALDOW}}
 * {{LOCALTIMESTAMP}}
-!! result
+!! html
 <ul>
 <li> 01
 </li>
 <ul>
 <li> 01
 </li>
@@ -6991,9 +6962,9 @@ Magic Words LOCAL (UTC)
 Magic Word: {{FULLPAGENAME}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{FULLPAGENAME}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{FULLPAGENAME}}
 {{FULLPAGENAME}}
-!! result
+!! html
 <p>User:Ævar Arnfjörð Bjarmason
 </p>
 !! end
 <p>User:Ævar Arnfjörð Bjarmason
 </p>
 !! end
@@ -7002,9 +6973,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{FULLPAGENAMEE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{FULLPAGENAMEE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{FULLPAGENAMEE}}
 {{FULLPAGENAMEE}}
-!! result
+!! html
 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
@@ -7013,9 +6984,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{TALKSPACE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{TALKSPACE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{TALKSPACE}}
 {{TALKSPACE}}
-!! result
+!! html
 <p>User talk
 </p>
 !! end
 <p>User talk
 </p>
 !! end
@@ -7024,9 +6995,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{TALKSPACE}}, same namespace
 !! options
 title=[[User talk:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{TALKSPACE}}, same namespace
 !! options
 title=[[User talk:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{TALKSPACE}}
 {{TALKSPACE}}
-!! result
+!! html
 <p>User talk
 </p>
 !! end
 <p>User talk
 </p>
 !! end
@@ -7035,9 +7006,9 @@ title=[[User talk:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{TALKSPACE}}, main namespace
 !! options
 title=[[Parser Test]]
 Magic Word: {{TALKSPACE}}, main namespace
 !! options
 title=[[Parser Test]]
-!! input
+!! wikitext
 {{TALKSPACE}}
 {{TALKSPACE}}
-!! result
+!! html
 <p>Talk
 </p>
 !! end
 <p>Talk
 </p>
 !! end
@@ -7046,9 +7017,9 @@ title=[[Parser Test]]
 Magic Word: {{TALKSPACEE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{TALKSPACEE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{TALKSPACEE}}
 {{TALKSPACEE}}
-!! result
+!! html
 <p>User_talk
 </p>
 !! end
 <p>User_talk
 </p>
 !! end
@@ -7057,9 +7028,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBJECTSPACE}}
 !! options
 title=[[User talk:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBJECTSPACE}}
 !! options
 title=[[User talk:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{SUBJECTSPACE}}
 {{SUBJECTSPACE}}
-!! result
+!! html
 <p>User
 </p>
 !! end
 <p>User
 </p>
 !! end
@@ -7068,9 +7039,9 @@ title=[[User talk:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBJECTSPACE}}, same namespace
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBJECTSPACE}}, same namespace
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{SUBJECTSPACE}}
 {{SUBJECTSPACE}}
-!! result
+!! html
 <p>User
 </p>
 !! end
 <p>User
 </p>
 !! end
@@ -7079,9 +7050,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBJECTSPACE}}, main namespace
 !! options
 title=[[Parser Test]]
 Magic Word: {{SUBJECTSPACE}}, main namespace
 !! options
 title=[[Parser Test]]
-!! input
+!! wikitext
 {{SUBJECTSPACE}}
 {{SUBJECTSPACE}}
-!! result
+!! html
 
 !! end
 
 
 !! end
 
@@ -7089,9 +7060,9 @@ title=[[Parser Test]]
 Magic Word: {{SUBJECTSPACEE}}
 !! options
 title=[[User talk:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBJECTSPACEE}}
 !! options
 title=[[User talk:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{SUBJECTSPACEE}}
 {{SUBJECTSPACEE}}
-!! result
+!! html
 <p>User
 </p>
 !! end
 <p>User
 </p>
 !! end
@@ -7100,9 +7071,9 @@ title=[[User talk:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{NAMESPACE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{NAMESPACE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{NAMESPACE}}
 {{NAMESPACE}}
-!! result
+!! html
 <p>User
 </p>
 !! end
 <p>User
 </p>
 !! end
@@ -7111,9 +7082,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{NAMESPACEE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{NAMESPACEE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{NAMESPACEE}}
 {{NAMESPACEE}}
-!! result
+!! html
 <p>User
 </p>
 !! end
 <p>User
 </p>
 !! end
@@ -7122,9 +7093,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{NAMESPACENUMBER}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{NAMESPACENUMBER}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{NAMESPACENUMBER}}
 {{NAMESPACENUMBER}}
-!! result
+!! html
 <p>2
 </p>
 !! end
 <p>2
 </p>
 !! end
@@ -7133,9 +7104,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBPAGENAME}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage
 Magic Word: {{SUBPAGENAME}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage
-!! input
+!! wikitext
 {{SUBPAGENAME}}
 {{SUBPAGENAME}}
-!! result
+!! html
 <p>sub ö
 </p>
 !! end
 <p>sub ö
 </p>
 !! end
@@ -7144,9 +7115,9 @@ title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage
 Magic Word: {{SUBPAGENAMEE}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage
 Magic Word: {{SUBPAGENAMEE}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage
-!! input
+!! wikitext
 {{SUBPAGENAMEE}}
 {{SUBPAGENAMEE}}
-!! result
+!! html
 <p>sub_%C3%B6
 </p>
 !! end
 <p>sub_%C3%B6
 </p>
 !! end
@@ -7155,9 +7126,9 @@ title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage
 Magic Word: {{ROOTPAGENAME}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage
 Magic Word: {{ROOTPAGENAME}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage
-!! input
+!! wikitext
 {{ROOTPAGENAME}}
 {{ROOTPAGENAME}}
-!! result
+!! html
 <p>Ævar Arnfjörð Bjarmason
 </p>
 !! end
 <p>Ævar Arnfjörð Bjarmason
 </p>
 !! end
@@ -7166,9 +7137,9 @@ title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage
 Magic Word: {{ROOTPAGENAMEE}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage
 Magic Word: {{ROOTPAGENAMEE}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage
-!! input
+!! wikitext
 {{ROOTPAGENAMEE}}
 {{ROOTPAGENAMEE}}
-!! result
+!! html
 <p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
 <p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
@@ -7177,9 +7148,9 @@ title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage
 Magic Word: {{BASEPAGENAME}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub]] subpage
 Magic Word: {{BASEPAGENAME}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub]] subpage
-!! input
+!! wikitext
 {{BASEPAGENAME}}
 {{BASEPAGENAME}}
-!! result
+!! html
 <p>Ævar Arnfjörð Bjarmason
 </p>
 !! end
 <p>Ævar Arnfjörð Bjarmason
 </p>
 !! end
@@ -7188,9 +7159,9 @@ title=[[Ævar Arnfjörð Bjarmason/sub]] subpage
 Magic Word: {{BASEPAGENAMEE}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub]] subpage
 Magic Word: {{BASEPAGENAMEE}}
 !! options
 title=[[Ævar Arnfjörð Bjarmason/sub]] subpage
-!! input
+!! wikitext
 {{BASEPAGENAMEE}}
 {{BASEPAGENAMEE}}
-!! result
+!! html
 <p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
 <p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
@@ -7199,9 +7170,9 @@ title=[[Ævar Arnfjörð Bjarmason/sub]] subpage
 Magic Word: {{TALKPAGENAME}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{TALKPAGENAME}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{TALKPAGENAME}}
 {{TALKPAGENAME}}
-!! result
+!! html
 <p>User talk:Ævar Arnfjörð Bjarmason
 </p>
 !! end
 <p>User talk:Ævar Arnfjörð Bjarmason
 </p>
 !! end
@@ -7210,9 +7181,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{TALKPAGENAMEE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{TALKPAGENAMEE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{TALKPAGENAMEE}}
 {{TALKPAGENAMEE}}
-!! result
+!! html
 <p>User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
 <p>User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
@@ -7221,9 +7192,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBJECTPAGENAME}}
 !! options
 title=[[User talk:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBJECTPAGENAME}}
 !! options
 title=[[User talk:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{SUBJECTPAGENAME}}
 {{SUBJECTPAGENAME}}
-!! result
+!! html
 <p>User:Ævar Arnfjörð Bjarmason
 </p>
 !! end
 <p>User:Ævar Arnfjörð Bjarmason
 </p>
 !! end
@@ -7232,18 +7203,18 @@ title=[[User talk:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBJECTPAGENAMEE}}
 !! options
 title=[[User talk:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{SUBJECTPAGENAMEE}}
 !! options
 title=[[User talk:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{SUBJECTPAGENAMEE}}
 {{SUBJECTPAGENAMEE}}
-!! result
+!! html
 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
 
 !! test
 Magic Word: {{NUMBEROFFILES}}
 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
 
 !! test
 Magic Word: {{NUMBEROFFILES}}
-!! input
+!! wikitext
 {{NUMBEROFFILES}}
 {{NUMBEROFFILES}}
-!! result
+!! html
 <p>4
 </p>
 !! end
 <p>4
 </p>
 !! end
@@ -7252,9 +7223,9 @@ Magic Word: {{NUMBEROFFILES}}
 Magic Word: {{PAGENAME}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{PAGENAME}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{PAGENAME}}
 {{PAGENAME}}
-!! result
+!! html
 <p>Ævar Arnfjörð Bjarmason
 </p>
 !! end
 <p>Ævar Arnfjörð Bjarmason
 </p>
 !! end
@@ -7263,9 +7234,9 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{PAGENAME}} with metacharacters
 !! options
 title=[['foo & bar = baz']]
 Magic Word: {{PAGENAME}} with metacharacters
 !! options
 title=[['foo & bar = baz']]
-!! input
+!! wikitext
 ''{{PAGENAME}}''
 ''{{PAGENAME}}''
-!! result
+!! html
 <p><i>&#39;foo &#38; bar &#61; baz&#39;</i>
 </p>
 !! end
 <p><i>&#39;foo &#38; bar &#61; baz&#39;</i>
 </p>
 !! end
@@ -7274,9 +7245,9 @@ title=[['foo & bar = baz']]
 Magic Word: {{PAGENAME}} with metacharacters (bug 26781)
 !! options
 title=[[*RFC 1234 http://example.com/]]
 Magic Word: {{PAGENAME}} with metacharacters (bug 26781)
 !! options
 title=[[*RFC 1234 http://example.com/]]
-!! input
+!! wikitext
 {{PAGENAME}}
 {{PAGENAME}}
-!! result
+!! html
 <p>&#42;RFC&#32;1234 http&#58;//example.com/
 </p>
 !! end
 <p>&#42;RFC&#32;1234 http&#58;//example.com/
 </p>
 !! end
@@ -7285,9 +7256,9 @@ title=[[*RFC 1234 http://example.com/]]
 Magic Word: {{PAGENAMEE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{PAGENAMEE}}
 !! options
 title=[[User:Ævar Arnfjörð Bjarmason]]
-!! input
+!! wikitext
 {{PAGENAMEE}}
 {{PAGENAMEE}}
-!! result
+!! html
 <p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
 <p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
 </p>
 !! end
@@ -7296,75 +7267,75 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 Magic Word: {{PAGENAMEE}} with metacharacters (bug 26781)
 !! options
 title=[[*RFC 1234 http://example.com/]]
 Magic Word: {{PAGENAMEE}} with metacharacters (bug 26781)
 !! options
 title=[[*RFC 1234 http://example.com/]]
-!! input
+!! wikitext
 {{PAGENAMEE}}
 {{PAGENAMEE}}
-!! result
+!! html
 <p>&#42;RFC_1234_http&#58;//example.com/
 </p>
 !! end
 
 !! test
 Magic Word: {{REVISIONID}}
 <p>&#42;RFC_1234_http&#58;//example.com/
 </p>
 !! end
 
 !! test
 Magic Word: {{REVISIONID}}
-!! input
+!! wikitext
 {{REVISIONID}}
 {{REVISIONID}}
-!! result
+!! html
 <p>1337
 </p>
 !! end
 
 !! test
 Magic Word: {{SCRIPTPATH}}
 <p>1337
 </p>
 !! end
 
 !! test
 Magic Word: {{SCRIPTPATH}}
-!! input
+!! wikitext
 {{SCRIPTPATH}}
 {{SCRIPTPATH}}
-!! result
+!! html
 <p>/
 </p>
 !! end
 
 !! test
 Magic Word: {{STYLEPATH}}
 <p>/
 </p>
 !! end
 
 !! test
 Magic Word: {{STYLEPATH}}
-!! input
+!! wikitext
 {{STYLEPATH}}
 {{STYLEPATH}}
-!! result
+!! html
 <p>/skins
 </p>
 !! end
 
 !! test
 Magic Word: {{SERVER}}
 <p>/skins
 </p>
 !! end
 
 !! test
 Magic Word: {{SERVER}}
-!! input
+!! wikitext
 {{SERVER}}
 {{SERVER}}
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://example.org">http://example.org</a>
 </p>
 !! end
 
 !! test
 Magic Word: {{SERVERNAME}}
 <p><a rel="nofollow" class="external free" href="http://example.org">http://example.org</a>
 </p>
 !! end
 
 !! test
 Magic Word: {{SERVERNAME}}
-!! input
+!! wikitext
 {{SERVERNAME}}
 {{SERVERNAME}}
-!! result
+!! html
 <p>example.org
 </p>
 !! end
 
 !! test
 Magic Word: {{SITENAME}}
 <p>example.org
 </p>
 !! end
 
 !! test
 Magic Word: {{SITENAME}}
-!! input
+!! wikitext
 {{SITENAME}}
 {{SITENAME}}
-!! result
+!! html
 <p>MediaWiki
 </p>
 !! end
 
 !! test
 Case-sensitive magic words, when cased differently, should just be template transclusions
 <p>MediaWiki
 </p>
 !! end
 
 !! test
 Case-sensitive magic words, when cased differently, should just be template transclusions
-!! input
+!! wikitext
 {{CurrentMonth}}
 {{currentday}}
 {{cURreNTweEK}}
 {{currentHour}}
 {{CurrentMonth}}
 {{currentday}}
 {{cURreNTweEK}}
 {{currentHour}}
-!! result
+!! html
 <p><a href="/index.php?title=Template:CurrentMonth&amp;action=edit&amp;redlink=1" class="new" title="Template:CurrentMonth (page does not exist)">Template:CurrentMonth</a>
 <a href="/index.php?title=Template:Currentday&amp;action=edit&amp;redlink=1" class="new" title="Template:Currentday (page does not exist)">Template:Currentday</a>
 <a href="/index.php?title=Template:CURreNTweEK&amp;action=edit&amp;redlink=1" class="new" title="Template:CURreNTweEK (page does not exist)">Template:CURreNTweEK</a>
 <p><a href="/index.php?title=Template:CurrentMonth&amp;action=edit&amp;redlink=1" class="new" title="Template:CurrentMonth (page does not exist)">Template:CurrentMonth</a>
 <a href="/index.php?title=Template:Currentday&amp;action=edit&amp;redlink=1" class="new" title="Template:Currentday (page does not exist)">Template:Currentday</a>
 <a href="/index.php?title=Template:CURreNTweEK&amp;action=edit&amp;redlink=1" class="new" title="Template:CURreNTweEK (page does not exist)">Template:CURreNTweEK</a>
@@ -7374,12 +7345,12 @@ Case-sensitive magic words, when cased differently, should just be template tran
 
 !! test
 Case-insensitive magic words should still work with weird casing.
 
 !! test
 Case-insensitive magic words should still work with weird casing.
-!! input
+!! wikitext
 {{sErVeRNaMe}}
 {{LCFirst:AOEU}}
 {{ucFIRST:aoeu}}
 {{SERver}}
 {{sErVeRNaMe}}
 {{LCFirst:AOEU}}
 {{ucFIRST:aoeu}}
 {{SERver}}
-!! result
+!! html
 <p>example.org
 aOEU
 Aoeu
 <p>example.org
 aOEU
 Aoeu
@@ -7389,88 +7360,88 @@ Aoeu
 
 !! test
 Namespace 1 {{ns:1}}
 
 !! test
 Namespace 1 {{ns:1}}
-!! input
+!! wikitext
 {{ns:1}}
 {{ns:1}}
-!! result
+!! html
 <p>Talk
 </p>
 !! end
 
 !! test
 Namespace 1 {{ns:01}}
 <p>Talk
 </p>
 !! end
 
 !! test
 Namespace 1 {{ns:01}}
-!! input
+!! wikitext
 {{ns:01}}
 {{ns:01}}
-!! result
+!! html
 <p>Talk
 </p>
 !! end
 
 !! test
 Namespace 0 {{ns:0}} (bug 4783)
 <p>Talk
 </p>
 !! end
 
 !! test
 Namespace 0 {{ns:0}} (bug 4783)
-!! input
+!! wikitext
 {{ns:0}}
 {{ns:0}}
-!! result
+!! html
 
 !! end
 
 !! test
 Namespace 0 {{ns:00}} (bug 4783)
 
 !! end
 
 !! test
 Namespace 0 {{ns:00}} (bug 4783)
-!! input
+!! wikitext
 {{ns:00}}
 {{ns:00}}
-!! result
+!! html
 
 !! end
 
 !! test
 Namespace -1 {{ns:-1}}
 
 !! end
 
 !! test
 Namespace -1 {{ns:-1}}
-!! input
+!! wikitext
 {{ns:-1}}
 {{ns:-1}}
-!! result
+!! html
 <p>Special
 </p>
 !! end
 
 !! test
 Namespace User {{ns:User}}
 <p>Special
 </p>
 !! end
 
 !! test
 Namespace User {{ns:User}}
-!! input
+!! wikitext
 {{ns:User}}
 {{ns:User}}
-!! result
+!! html
 <p>User
 </p>
 !! end
 
 !! test
 Namespace User talk {{ns:User_talk}}
 <p>User
 </p>
 !! end
 
 !! test
 Namespace User talk {{ns:User_talk}}
-!! input
+!! wikitext
 {{ns:User_talk}}
 {{ns:User_talk}}
-!! result
+!! html
 <p>User talk
 </p>
 !! end
 
 !! test
 Namespace User talk {{ns:uSeR tAlK}}
 <p>User talk
 </p>
 !! end
 
 !! test
 Namespace User talk {{ns:uSeR tAlK}}
-!! input
+!! wikitext
 {{ns:uSeR tAlK}}
 {{ns:uSeR tAlK}}
-!! result
+!! html
 <p>User talk
 </p>
 !! end
 
 !! test
 Namespace File {{ns:File}}
 <p>User talk
 </p>
 !! end
 
 !! test
 Namespace File {{ns:File}}
-!! input
+!! wikitext
 {{ns:File}}
 {{ns:File}}
-!! result
+!! html
 <p>File
 </p>
 !! end
 
 !! test
 Namespace File {{ns:Image}}
 <p>File
 </p>
 !! end
 
 !! test
 Namespace File {{ns:Image}}
-!! input
+!! wikitext
 {{ns:Image}}
 {{ns:Image}}
-!! result
+!! html
 <p>File
 </p>
 !! end
 <p>File
 </p>
 !! end
@@ -7479,9 +7450,9 @@ Namespace File {{ns:Image}}
 Namespace (lang=de) Benutzer {{ns:User}}
 !! options
 language=de
 Namespace (lang=de) Benutzer {{ns:User}}
 !! options
 language=de
-!! input
+!! wikitext
 {{ns:User}}
 {{ns:User}}
-!! result
+!! html
 <p>Benutzer
 </p>
 !! end
 <p>Benutzer
 </p>
 !! end
@@ -7490,9 +7461,9 @@ language=de
 Namespace (lang=de) Benutzer Diskussion {{ns:3}}
 !! options
 language=de
 Namespace (lang=de) Benutzer Diskussion {{ns:3}}
 !! options
 language=de
-!! input
+!! wikitext
 {{ns:3}}
 {{ns:3}}
-!! result
+!! html
 <p>Benutzer Diskussion
 </p>
 !! end
 <p>Benutzer Diskussion
 </p>
 !! end
@@ -7500,12 +7471,12 @@ language=de
 
 !! test
 Urlencode
 
 !! test
 Urlencode
-!! input
+!! wikitext
 {{urlencode:hi world?!}}
 {{urlencode:hi world?!|WIKI}}
 {{urlencode:hi world?!|PATH}}
 {{urlencode:hi world?!|QUERY}}
 {{urlencode:hi world?!}}
 {{urlencode:hi world?!|WIKI}}
 {{urlencode:hi world?!|PATH}}
 {{urlencode:hi world?!|QUERY}}
-!! result
+!! html
 <p>hi+world%3F%21
 hi_world%3F!
 hi%20world%3F%21
 <p>hi+world%3F%21
 hi_world%3F!
 hi%20world%3F%21
@@ -7513,41 +7484,74 @@ hi+world%3F%21
 </p>
 !! end
 
 </p>
 !! end
 
+!! test
+Magic Word: prioritize type info over data-parsoid
+!! options
+parsoid=html2wt
+!! wikitext
+__FORCETOC__
+!! html
+<meta property="mw:PageProp/forcetoc" data-parsoid='{"src":"__NOTOC__","magicSrc":"__NOTOC__"}'/>
+!! end
+
+!! test
+Magic Word: serialize on separate line (parsoid)
+!! options
+parsoid=wt2wt,html2wt
+!! wikitext
+foo
+__NOTOC__
+bar
+!! html
+foo<meta property="mw:PageProp/notoc"/>bar
+!! end
+
+!! test
+Magic Word: rt non-english wikis
+!! options
+parsoid=wt2wt
+language=de
+!! wikitext
+__NOEDITSECTION__
+!! html
+<meta property="mw:PageProp/noeditsection" data-parsoid='{"src":"__NOEDITSECTION__","magicSrc":"__NOEDITSECTION__"}'/>
+!! end
+
 ###
 ### Magic links
 ###
 !! test
 Magic links: internal link to RFC (bug 479)
 ###
 ### Magic links
 ###
 !! test
 Magic links: internal link to RFC (bug 479)
-!! input
+!! wikitext
 [[RFC 123]]
 [[RFC 123]]
-!! result
+!! html
 <p><a href="/index.php?title=RFC_123&amp;action=edit&amp;redlink=1" class="new" title="RFC 123 (page does not exist)">RFC 123</a>
 </p>
 !! end
 
 !! test
 Magic links: RFC (bug 479)
 <p><a href="/index.php?title=RFC_123&amp;action=edit&amp;redlink=1" class="new" title="RFC 123 (page does not exist)">RFC 123</a>
 </p>
 !! end
 
 !! test
 Magic links: RFC (bug 479)
-!! input
+!! wikitext
 RFC 822
 RFC 822
-!! result
+!! html
 <p><a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc822">RFC 822</a>
 </p>
 !! end
 
 !! test
 Magic links: ISBN (bug 1937)
 <p><a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc822">RFC 822</a>
 </p>
 !! end
 
 !! test
 Magic links: ISBN (bug 1937)
-!! input
+!! wikitext
 ISBN 0-306-40615-2
 ISBN 0-306-40615-2
-!! result
+!! html
 <p><a href="/wiki/Special:BookSources/0306406152" class="internal mw-magiclink-isbn">ISBN 0-306-40615-2</a>
 </p>
 !! end
 
 !! test
 Magic links: PMID incorrectly converts space to underscore
 <p><a href="/wiki/Special:BookSources/0306406152" class="internal mw-magiclink-isbn">ISBN 0-306-40615-2</a>
 </p>
 !! end
 
 !! test
 Magic links: PMID incorrectly converts space to underscore
-!! input
+!! wikitext
 PMID 1234
 PMID 1234
-!! result
+!! html
 <p><a class="external mw-magiclink-pmid" rel="nofollow" href="//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a>
 </p>
 !! end
 <p><a class="external mw-magiclink-pmid" rel="nofollow" href="//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a>
 </p>
 !! end
@@ -7558,31 +7562,42 @@ PMID 1234
 
 !! test
 Nonexistent template
 
 !! test
 Nonexistent template
-!! input
+!! wikitext
 {{thistemplatedoesnotexist}}
 {{thistemplatedoesnotexist}}
-!! result
+!! html
 <p><a href="/index.php?title=Template:Thistemplatedoesnotexist&amp;action=edit&amp;redlink=1" class="new" title="Template:Thistemplatedoesnotexist (page does not exist)">Template:Thistemplatedoesnotexist</a>
 </p>
 !! end
 
 !! test
 Template with invalid target containing tags
 <p><a href="/index.php?title=Template:Thistemplatedoesnotexist&amp;action=edit&amp;redlink=1" class="new" title="Template:Thistemplatedoesnotexist (page does not exist)">Template:Thistemplatedoesnotexist</a>
 </p>
 !! end
 
 !! test
 Template with invalid target containing tags
-!! input
+!! wikitext
 {{a<b>b</b>|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}}
 {{a<b>b</b>|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}}
-!! result
+!! html
 <p>{{a<b>b</b>|foo|a=b|a = b}}
 </p>
 !! end
 
 !! test
 Template with invalid target containing unclosed tag
 <p>{{a<b>b</b>|foo|a=b|a = b}}
 </p>
 !! end
 
 !! test
 Template with invalid target containing unclosed tag
-!! input
+!! wikitext
 {{a<b>|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}}
 {{a<b>|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}}
-!! result
+!! html
 <p>{{a<b>|foo|a=b|a = b}}</b>
 </p>
 !! end
 
 <p>{{a<b>|foo|a=b|a = b}}</b>
 </p>
 !! end
 
+!! test
+Template with invalid target containing wikilink
+!! wikitext
+{{[[Main Page]]}}
+!! html/php
+<p>{{<a href="/wiki/Main_Page" title="Main Page">Main Page</a>}}
+</p>
+!! html/parsoid
+<p><span typeof="mw:Transclusion" about="#mwt1" data-mw='{"parts":[{"template":{"target":{"wt":"[[Main Page]]"},"params":{},"i":0}}]}'>{{</span><a rel="mw:WikiLink" href="./Main_Page" about="#mwt1">Main Page</a><span about="#mwt1">}}</span></p>
+!! end
+
 !! article
 Template:test
 !! text
 !! article
 Template:test
 !! text
@@ -7591,18 +7606,18 @@ This is a test template
 
 !! test
 Simple template
 
 !! test
 Simple template
-!! input
+!! wikitext
 {{test}}
 {{test}}
-!! result
+!! html
 <p>This is a test template
 </p>
 !! end
 
 !! test
 Template with explicit namespace
 <p>This is a test template
 </p>
 !! end
 
 !! test
 Template with explicit namespace
-!! input
+!! wikitext
 {{Template:test}}
 {{Template:test}}
-!! result
+!! html
 <p>This is a test template
 </p>
 !! end
 <p>This is a test template
 </p>
 !! end
@@ -7616,9 +7631,9 @@ This is a test template with parameter {{{param}}}
 
 !! test
 Template parameter
 
 !! test
 Template parameter
-!! input
+!! wikitext
 {{paramtest|param=foo}}
 {{paramtest|param=foo}}
-!! result
+!! html
 <p>This is a test template with parameter foo
 </p>
 !! end
 <p>This is a test template with parameter foo
 </p>
 !! end
@@ -7631,9 +7646,9 @@ Template:paramtestnum
 
 !! test
 Template unnamed parameter
 
 !! test
 Template unnamed parameter
-!! input
+!! wikitext
 {{paramtestnum|Main Page|the main page}}
 {{paramtestnum|Main Page|the main page}}
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">the main page</a>
 </p>
 !! end
 <p><a href="/wiki/Main_Page" title="Main Page">the main page</a>
 </p>
 !! end
@@ -7670,27 +7685,27 @@ Template:templateasargtest2
 
 !! test
 Template with template name as unnamed argument
 
 !! test
 Template with template name as unnamed argument
-!! input
+!! wikitext
 {{templateasargtestnum|templatesimple}}
 {{templateasargtestnum|templatesimple}}
-!! result
+!! html
 <p>(test)
 </p>
 !! end
 
 !! test
 Template with template name as argument
 <p>(test)
 </p>
 !! end
 
 !! test
 Template with template name as argument
-!! input
+!! wikitext
 {{templateasargtest|templ=simple}}
 {{templateasargtest|templ=simple}}
-!! result
+!! html
 <p>(test)
 </p>
 !! end
 
 !! test
 Template with template name as argument (2)
 <p>(test)
 </p>
 !! end
 
 !! test
 Template with template name as argument (2)
-!! input
+!! wikitext
 {{templateasargtest2|templ=templatesimple}}
 {{templateasargtest2|templ=templatesimple}}
-!! result
+!! html
 <p>(test)
 </p>
 !! end
 <p>(test)
 </p>
 !! end
@@ -7709,58 +7724,58 @@ Template:templa
 
 !! test
 Template with default value
 
 !! test
 Template with default value
-!! input
+!! wikitext
 {{templateasargtestdefault}}
 {{templateasargtestdefault}}
-!! result
+!! html
 <p>(test)
 </p>
 !! end
 
 !! test
 Template with default value (value set)
 <p>(test)
 </p>
 !! end
 
 !! test
 Template with default value (value set)
-!! input
+!! wikitext
 {{templateasargtestdefault|templ=templa}}
 {{templateasargtestdefault|templ=templa}}
-!! result
+!! html
 <p><b>templ</b>
 </p>
 !! end
 
 !! test
 Template redirect
 <p><b>templ</b>
 </p>
 !! end
 
 !! test
 Template redirect
-!! input
+!! wikitext
 {{templateredirect}}
 {{templateredirect}}
-!! result
+!! html
 <p>(test)
 </p>
 !! end
 
 !! test
 Template with argument in separate line
 <p>(test)
 </p>
 !! end
 
 !! test
 Template with argument in separate line
-!! input
+!! wikitext
 {{ templateasargtest  |
  templ = simple }}
 {{ templateasargtest  |
  templ = simple }}
-!! result
+!! html
 <p>(test)
 </p>
 !! end
 
 !! test
 Template with complex template as argument
 <p>(test)
 </p>
 !! end
 
 !! test
 Template with complex template as argument
-!! input
+!! wikitext
 {{paramtest|
   param ={{ templateasargtest  |
  templ = simple }}}}
 {{paramtest|
   param ={{ templateasargtest  |
  templ = simple }}}}
-!! result
+!! html
 <p>This is a test template with parameter (test)
 </p>
 !! end
 
 !! test
 Template with thumb image (with link in description)
 <p>This is a test template with parameter (test)
 </p>
 !! end
 
 !! test
 Template with thumb image (with link in description)
-!! input
+!! wikitext
 {{paramtest|
   param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}}
 {{paramtest|
   param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}}
-!! result
+!! html
 This is a test template with parameter <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&amp;wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a>  <div class="thumbcaption"><a href="/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">caption</a></div></div></div>
 
 !! end
 This is a test template with parameter <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&amp;wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a>  <div class="thumbcaption"><a href="/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">caption</a></div></div></div>
 
 !! end
@@ -7774,22 +7789,22 @@ Template:complextemplate
 
 !! test
 Template with complex arguments
 
 !! test
 Template with complex arguments
-!! input
+!! wikitext
 {{complextemplate|
   param ={{ templateasargtest  |
  templ = simple }}|[[Template:complextemplate|link]]}}
 {{complextemplate|
   param ={{ templateasargtest  |
  templ = simple }}|[[Template:complextemplate|link]]}}
-!! result
+!! html
 <p><a href="/wiki/Template:Complextemplate" title="Template:Complextemplate">link</a> This is a test template with parameter (test)
 </p>
 !! end
 
 !! test
 BUG 553: link with two variables in a piped link
 <p><a href="/wiki/Template:Complextemplate" title="Template:Complextemplate">link</a> This is a test template with parameter (test)
 </p>
 !! end
 
 !! test
 BUG 553: link with two variables in a piped link
-!! input
+!! wikitext
 {|
 |[[{{{1}}}|{{{2}}}]]
 |}
 {|
 |[[{{{1}}}|{{{2}}}]]
 |}
-!! result
+!! html
 <table>
 <tr>
 <td>[[{{{1}}}|{{{2}}}]]
 <table>
 <tr>
 <td>[[{{{1}}}|{{{2}}}]]
@@ -7799,9 +7814,9 @@ BUG 553: link with two variables in a piped link
 
 !! test
 Magic variable as template parameter
 
 !! test
 Magic variable as template parameter
-!! input
+!! wikitext
 {{paramtest|param={{SITENAME}}}}
 {{paramtest|param={{SITENAME}}}}
-!! result
+!! html
 <p>This is a test template with parameter MediaWiki
 </p>
 !! end
 <p>This is a test template with parameter MediaWiki
 </p>
 !! end
@@ -7814,18 +7829,18 @@ Template:linktest
 
 !! test
 Template parameter as link source
 
 !! test
 Template parameter as link source
-!! input
+!! wikitext
 {{linktest|param=Main Page}}
 {{linktest|param=Main Page}}
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">link</a>
 </p>
 !! end
 
 !!test
 Template-generated attribute string (k='v')
 <p><a href="/wiki/Main_Page" title="Main Page">link</a>
 </p>
 !! end
 
 !!test
 Template-generated attribute string (k='v')
-!!input
+!! wikitext
 <span {{attr_str|id|v1}}>bar</span>
 <span {{attr_str|id|v1}}>bar</span>
-!!result
+!! html
 <p><span id="v1">bar</span>
 </p>
 !!end
 <p><span id="v1">bar</span>
 </p>
 !!end
@@ -7838,9 +7853,9 @@ including another template, {{paramtest|param={{{arg}}}}}
 
 !! test
 Template passing argument to another template
 
 !! test
 Template passing argument to another template
-!! input
+!! wikitext
 {{paramtest2|arg='hmm'}}
 {{paramtest2|arg='hmm'}}
-!! result
+!! html
 <p>including another template, This is a test template with parameter 'hmm'
 </p>
 !! end
 <p>including another template, This is a test template with parameter 'hmm'
 </p>
 !! end
@@ -7853,13 +7868,13 @@ Main Page
 
 !! test
 Template as link source
 
 !! test
 Template as link source
-!! input
+!! wikitext
 [[{{linktest2}}]]
 
 [[{{linktest2}}|Main Page]]
 
 [[{{linktest2}}]]Page
 [[{{linktest2}}]]
 
 [[{{linktest2}}|Main Page]]
 
 [[{{linktest2}}]]Page
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 </p><p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 </p><p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>Page
 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 </p><p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 </p><p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>Page
@@ -7881,18 +7896,18 @@ Template:loop2
 
 !! test
 Template infinite loop
 
 !! test
 Template infinite loop
-!! input
+!! wikitext
 {{loop1}}
 {{loop1}}
-!! result
+!! html
 <p><span class="error">Template loop detected: <a href="/wiki/Template:Loop1" title="Template:Loop1">Template:Loop1</a></span>
 </p>
 !! end
 
 !! test
 Template from main namespace
 <p><span class="error">Template loop detected: <a href="/wiki/Template:Loop1" title="Template:Loop1">Template:Loop1</a></span>
 </p>
 !! end
 
 !! test
 Template from main namespace
-!! input
+!! wikitext
 {{:Main Page}}
 {{:Main Page}}
-!! result
+!! html
 <p>blah blah
 </p>
 !! end
 <p>blah blah
 </p>
 !! end
@@ -7909,9 +7924,9 @@ Template:table
 
 !! test
 BUG 529: Template with table, not included at beginning of line
 
 !! test
 BUG 529: Template with table, not included at beginning of line
-!! input
+!! wikitext
 foo {{table}}
 foo {{table}}
-!! result
+!! html
 <p>foo 
 </p>
 <table>
 <p>foo 
 </p>
 <table>
@@ -7928,10 +7943,10 @@ foo {{table}}
 
 !! test
 BUG 523: Template shouldn't eat newline (or add an extra one before table)
 
 !! test
 BUG 523: Template shouldn't eat newline (or add an extra one before table)
-!! input
+!! wikitext
 foo
 {{table}}
 foo
 {{table}}
-!! result
+!! html
 <p>foo
 </p>
 <table>
 <p>foo
 </p>
 <table>
@@ -7948,22 +7963,22 @@ foo
 
 !! test
 BUG 41: Template parameters shown as broken links
 
 !! test
 BUG 41: Template parameters shown as broken links
-!! input
+!! wikitext
 {{{parameter}}}
 {{{parameter}}}
-!! result
+!! html
 <p>{{{parameter}}}
 </p>
 !! end
 
 !! test
 Template with targets containing wikilinks
 <p>{{{parameter}}}
 </p>
 !! end
 
 !! test
 Template with targets containing wikilinks
-!! input
+!! wikitext
 {{[[foo]]}}
 
 {{[[{{echo|foo}}]]}}
 
 {{{{echo|[[foo}}]]}}
 {{[[foo]]}}
 
 {{[[{{echo|foo}}]]}}
 
 {{{{echo|[[foo}}]]}}
-!! result
+!! html
 <p>{{<a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">foo</a>}}
 </p><p>{{<a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">foo</a>}}
 </p><p>{{[[foo}}]]
 <p>{{<a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">foo</a>}}
 </p><p>{{<a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">foo</a>}}
 </p><p>{{[[foo}}]]
@@ -7984,9 +7999,9 @@ Template:MSGNW test
 msgnw keyword
 !! options
 disabled
 msgnw keyword
 !! options
 disabled
-!! input
+!! wikitext
 {{msgnw:MSGNW test}}
 {{msgnw:MSGNW test}}
-!! result
+!! html
 <p>''None'' of '''this''' should be 
 * interpreted
  but rather passed unmodified
 <p>''None'' of '''this''' should be 
 * interpreted
  but rather passed unmodified
@@ -7996,9 +8011,9 @@ disabled
 
 !! test
 int keyword
 
 !! test
 int keyword
-!! input
+!! wikitext
 {{int:youhavenewmessages|lots of money|not!}}
 {{int:youhavenewmessages|lots of money|not!}}
-!! result
+!! html
 <p>You have lots of money (not!).
 </p>
 !! end
 <p>You have lots of money (not!).
 </p>
 !! end
@@ -8011,9 +8026,9 @@ Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
 
 !! test
 <includeonly> and <noinclude> being included
 
 !! test
 <includeonly> and <noinclude> being included
-!! input
+!! wikitext
 {{Includes}}
 {{Includes}}
-!! result
+!! html
 <p>Foobar
 </p>
 !! end
 <p>Foobar
 </p>
 !! end
@@ -8026,9 +8041,9 @@ Template:Includes2
 
 !! test
 <onlyinclude> being included
 
 !! test
 <onlyinclude> being included
-!! input
+!! wikitext
 {{Includes2}}
 {{Includes2}}
-!! result
+!! html
 <p>Foo
 </p>
 !! end
 <p>Foo
 </p>
 !! end
@@ -8042,66 +8057,66 @@ Template:Includes3
 
 !! test
 <onlyinclude> and <includeonly> being included
 
 !! test
 <onlyinclude> and <includeonly> being included
-!! input
+!! wikitext
 {{Includes3}}
 {{Includes3}}
-!! result
+!! html
 <p>Foo
 </p>
 !! end
 
 !! test
 <includeonly> and <noinclude> on a page
 <p>Foo
 </p>
 !! end
 
 !! test
 <includeonly> and <noinclude> on a page
-!! input
+!! wikitext
 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
-!! result
+!! html
 <p>Foozar
 </p>
 !! end
 
 !! test
 Un-closed <noinclude>
 <p>Foozar
 </p>
 !! end
 
 !! test
 Un-closed <noinclude>
-!! input
+!! wikitext
 <noinclude>
 <noinclude>
-!! result
+!! html
 !! end
 
 !! test
 <onlyinclude> on a page
 !! end
 
 !! test
 <onlyinclude> on a page
-!! input
+!! wikitext
 <onlyinclude>Foo</onlyinclude>bar
 <onlyinclude>Foo</onlyinclude>bar
-!! result
+!! html
 <p>Foobar
 </p>
 !! end
 
 !! test
 Un-closed <onlyinclude>
 <p>Foobar
 </p>
 !! end
 
 !! test
 Un-closed <onlyinclude>
-!! input
+!! wikitext
 <onlyinclude>
 <onlyinclude>
-!! result
+!! html
 !! end
 
 !!test
 Self-closed noinclude, includeonly, onlyinclude tags
 !! end
 
 !!test
 Self-closed noinclude, includeonly, onlyinclude tags
-!!input
+!! wikitext
 <noinclude />
 <includeonly />
 <onlyinclude />
 <noinclude />
 <includeonly />
 <onlyinclude />
-!!result
+!! html
 <p><br />
 </p>
 !!end
 
 !!test
 Unbalanced includeonly and noinclude tags
 <p><br />
 </p>
 !!end
 
 !!test
 Unbalanced includeonly and noinclude tags
-!!input
+!! wikitext
 {|
 |a</noinclude>
 |b</noinclude></noinclude>
 |c</noinclude></includeonly>
 |d</includeonly></includeonly>
 |}
 {|
 |a</noinclude>
 |b</noinclude></noinclude>
 |c</noinclude></includeonly>
 |d</includeonly></includeonly>
 |}
-!!result
+!! html
 <table>
 <tr>
 <td>a
 <table>
 <tr>
 <td>a
@@ -8126,9 +8141,9 @@ Template:Includeonly section
 
 !! test
 Bug 6563: Edit link generation for section shown by <includeonly>
 
 !! test
 Bug 6563: Edit link generation for section shown by <includeonly>
-!! input
+!! wikitext
 {{includeonly section}}
 {{includeonly section}}
-!! result
+!! html
 <h2><span class="mw-headline" id="Includeonly_section">Includeonly section</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Includeonly_section&amp;action=edit&amp;section=T-1" title="Template:Includeonly section">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Section_T-1">Section T-1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Includeonly_section&amp;action=edit&amp;section=T-2" title="Template:Includeonly section">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 <h2><span class="mw-headline" id="Includeonly_section">Includeonly section</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Includeonly_section&amp;action=edit&amp;section=T-1" title="Template:Includeonly section">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Section_T-1">Section T-1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Includeonly_section&amp;action=edit&amp;section=T-2" title="Template:Includeonly section">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
@@ -8139,23 +8154,23 @@ Bug 6563: Edit link generation for section shown by <includeonly>
 Bug 6563: Section extraction for section shown by <includeonly>
 !! options
 section=T-2
 Bug 6563: Section extraction for section shown by <includeonly>
 !! options
 section=T-2
-!! input
+!! wikitext
 <includeonly>
 ==Includeonly section==
 </includeonly>
 ==Section T-2==
 <includeonly>
 ==Includeonly section==
 </includeonly>
 ==Section T-2==
-!! result
+!! html
 ==Section T-2==
 !! end
 
 !! test
 Bug 6563: Edit link generation for section suppressed by <includeonly>
 ==Section T-2==
 !! end
 
 !! test
 Bug 6563: Edit link generation for section suppressed by <includeonly>
-!! input
+!! wikitext
 <includeonly>
 ==Includeonly section==
 </includeonly>
 ==Section 1==
 <includeonly>
 ==Includeonly section==
 </includeonly>
 ==Section 1==
-!! result
+!! html
 <h2><span class="mw-headline" id="Section_1">Section 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
 <h2><span class="mw-headline" id="Section_1">Section 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
@@ -8164,20 +8179,20 @@ Bug 6563: Edit link generation for section suppressed by <includeonly>
 Bug 6563: Section extraction for section suppressed by <includeonly>
 !! options
 section=1
 Bug 6563: Section extraction for section suppressed by <includeonly>
 !! options
 section=1
-!! input
+!! wikitext
 <includeonly>
 ==Includeonly section==
 </includeonly>
 ==Section 1==
 <includeonly>
 ==Includeonly section==
 </includeonly>
 ==Section 1==
-!! result
+!! html
 ==Section 1==
 !! end
 
 !! test
 Un-closed <includeonly>
 ==Section 1==
 !! end
 
 !! test
 Un-closed <includeonly>
-!! input
+!! wikitext
 <includeonly>
 <includeonly>
-!! result
+!! html
 !! end
 
 # TODO: test with DOM fragment reuse!
 !! end
 
 # TODO: test with DOM fragment reuse!
@@ -8185,7 +8200,7 @@ Un-closed <includeonly>
 Parsoid: DOM fragment reuse
 !! options
 parsoid=wt2wt,wt2html
 Parsoid: DOM fragment reuse
 !! options
 parsoid=wt2wt,wt2html
-!! input
+!! wikitext
 a{{echo|b<table></table>c}}d
 
 a{{echo|b
 a{{echo|b<table></table>c}}d
 
 a{{echo|b
@@ -8197,7 +8212,7 @@ c}}d
 <table></table>
 
 b}}
 <table></table>
 
 b}}
-!! result
+!! html
 a<span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b
 <table></table>c"}},"i":0}}]}'>b</span>
 <table about="#mwt1"></table><span about="#mwt1">c</span>d
 a<span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b
 <table></table>c"}},"i":0}}]}'>b</span>
 <table about="#mwt1"></table><span about="#mwt1">c</span>d
@@ -8223,11 +8238,11 @@ a<span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"t
 Parsoid: Merge double tds (bug 50603)
 !! options
 parsoid
 Parsoid: Merge double tds (bug 50603)
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 |{{echo|{{!}} foo}}
 |}
 {|
 |{{echo|{{!}} foo}}
 |}
-!! result
+!! html
 <table><tbody>
 <tr><td about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"{{!}} foo"}},"i":0}}]}'> foo</td></tr>
 </tbody></table>
 <table><tbody>
 <tr><td about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"{{!}} foo"}},"i":0}}]}'> foo</td></tr>
 </tbody></table>
@@ -8237,13 +8252,13 @@ parsoid
 Parsoid: Merge double tds in nested transclusion content (bug 50603)
 !! options
 parsoid
 Parsoid: Merge double tds in nested transclusion content (bug 50603)
 !! options
 parsoid
-!! input
+!! wikitext
 {{echo|<div>}}
 {|
 |{{echo|{{!}} foo}}
 |}
 {{echo|</div>}}
 {{echo|<div>}}
 {|
 |{{echo|{{!}} foo}}
 |}
 {{echo|</div>}}
-!! result
+!! html
 <div about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<div>"}},"i":0}},"\n{|\n|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"{{!}} foo"}},"i":1}},"\n|}\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"</div>"}},"i":2}}]}'>
 <table><tbody>
 <tr><td data-mw='{"parts":["|"]}'> foo</td></tr>
 <div about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<div>"}},"i":0}},"\n{|\n|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"{{!}} foo"}},"i":1}},"\n|}\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"</div>"}},"i":2}}]}'>
 <table><tbody>
 <tr><td data-mw='{"parts":["|"]}'> foo</td></tr>
@@ -8256,28 +8271,28 @@ parsoid
 ###
 !!test
 0. includeonly around the entire attribute
 ###
 !!test
 0. includeonly around the entire attribute
-!!input
+!! wikitext
 <span <includeonly>id="v1"</includeonly><noinclude>id="v2"</noinclude>>bar</span>
 <span <includeonly>id="v1"</includeonly><noinclude>id="v2"</noinclude>>bar</span>
-!!result
+!! html
 <p><span id="v2">bar</span>
 </p>
 !!end
 
 !!test
 1. includeonly in html attr key
 <p><span id="v2">bar</span>
 </p>
 !!end
 
 !!test
 1. includeonly in html attr key
-!!input
+!! wikitext
 <span <noinclude>id</noinclude><includeonly>about</includeonly>="foo">bar</span>
 <span <noinclude>id</noinclude><includeonly>about</includeonly>="foo">bar</span>
-!!result
+!! html
 <p><span id="foo">bar</span>
 </p>
 !!end
 
 !!test
 2. includeonly in html attr value
 <p><span id="foo">bar</span>
 </p>
 !!end
 
 !!test
 2. includeonly in html attr value
-!!input
+!! wikitext
 <span id="<noinclude>v1</noinclude><includeonly>v2</includeonly>">bar</span>
 <span id=<noinclude>"v1"</noinclude><includeonly>"v2"</includeonly>>bar</span>
 <span id="<noinclude>v1</noinclude><includeonly>v2</includeonly>">bar</span>
 <span id=<noinclude>"v1"</noinclude><includeonly>"v2"</includeonly>>bar</span>
-!!result
+!! html
 <p><span id="v1">bar</span>
 <span id="v1">bar</span>
 </p>
 <p><span id="v1">bar</span>
 <span id="v1">bar</span>
 </p>
@@ -8285,16 +8300,16 @@ parsoid
 
 !!test
 3. includeonly in part of an attr value
 
 !!test
 3. includeonly in part of an attr value
-!!input
+!! wikitext
 <span style="color:<noinclude>red</noinclude><includeonly>blue</includeonly>;">bar</span>
 <span style="color:<noinclude>red</noinclude><includeonly>blue</includeonly>;">bar</span>
-!!result
+!! html
 <p><span style="color:red;">bar</span>
 </p>
 !!end
 
 !!test
 4. includeonly in table attributes
 <p><span style="color:red;">bar</span>
 </p>
 !!end
 
 !!test
 4. includeonly in table attributes
-!!input
+!! wikitext
 {|
 |- <noinclude>
 |-
 {|
 |- <noinclude>
 |-
@@ -8305,7 +8320,7 @@ parsoid
 |b
 </includeonly>
 |}
 |b
 </includeonly>
 |}
-!!result
+!! html
 <table>
 
 
 <table>
 
 
@@ -8329,27 +8344,27 @@ Template:quote
 
 !!test
 Templates: Template Name/Arg clash: 1. Use of positional param
 
 !!test
 Templates: Template Name/Arg clash: 1. Use of positional param
-!!input
+!! wikitext
 {{quote|foo}}
 {{quote|foo}}
-!!result
+!! html
 <p>foo
 </p>
 !!end
 
 !!test
 Templates: Template Name/Arg clash: 2. Use of named param
 <p>foo
 </p>
 !!end
 
 !!test
 Templates: Template Name/Arg clash: 2. Use of named param
-!!input
+!! wikitext
 {{quote|quote=foo}}
 {{quote|quote=foo}}
-!!result
+!! html
 <p>foo
 </p>
 !!end
 
 !!test
 Templates: Template Name/Arg clash: 3. Use of named param with empty input
 <p>foo
 </p>
 !!end
 
 !!test
 Templates: Template Name/Arg clash: 3. Use of named param with empty input
-!!input
+!! wikitext
 {{quote|quote}}
 {{quote|quote}}
-!!result
+!! html
 <p>quote
 </p>
 !!end
 <p>quote
 </p>
 !!end
@@ -8360,19 +8375,19 @@ Templates: Template Name/Arg clash: 3. Use of named param with empty input
 
 !!test
 Templates: 1. Simple use
 
 !!test
 Templates: 1. Simple use
-!!input
+!! wikitext
 {{echo|Foo}}
 {{echo|Foo}}
-!!result
+!! html
 <p>Foo
 </p>
 !!end
 
 !!test
 Templates: 2. Inside a block tag
 <p>Foo
 </p>
 !!end
 
 !!test
 Templates: 2. Inside a block tag
-!!input
+!! wikitext
 <div>{{echo|Foo}}</div>
 <blockquote>{{echo|Foo}}</blockquote>
 <div>{{echo|Foo}}</div>
 <blockquote>{{echo|Foo}}</blockquote>
-!!result
+!! html
 <div>Foo</div>
 <blockquote>Foo</blockquote>
 
 <div>Foo</div>
 <blockquote>Foo</blockquote>
 
@@ -8380,10 +8395,10 @@ Templates: 2. Inside a block tag
 
 !!test
 Templates: P-wrapping: 1a. Templates on consecutive lines
 
 !!test
 Templates: P-wrapping: 1a. Templates on consecutive lines
-!!input
+!! wikitext
 {{echo|Foo}}
 {{echo|bar}}
 {{echo|Foo}}
 {{echo|bar}}
-!!result
+!! html
 <p>Foo
 bar
 </p>
 <p>Foo
 bar
 </p>
@@ -8391,12 +8406,12 @@ bar
 
 !!test
 Templates: P-wrapping: 1b. Templates on consecutive lines
 
 !!test
 Templates: P-wrapping: 1b. Templates on consecutive lines
-!!input
+!! wikitext
 Foo
 
 {{echo|bar}}
 {{echo|baz}}
 Foo
 
 {{echo|bar}}
 {{echo|baz}}
-!!result
+!! html
 <p>Foo
 </p><p>bar
 baz
 <p>Foo
 </p><p>bar
 baz
@@ -8405,10 +8420,10 @@ baz
 
 !!test
 Templates: P-wrapping: 1c. Templates on consecutive lines
 
 !!test
 Templates: P-wrapping: 1c. Templates on consecutive lines
-!!input
+!! wikitext
 {{echo|Foo}}
 {{echo|bar}} <div>baz</div>
 {{echo|Foo}}
 {{echo|bar}} <div>baz</div>
-!!result
+!! html
 <p>Foo
 </p>
 bar <div>baz</div>
 <p>Foo
 </p>
 bar <div>baz</div>
@@ -8419,10 +8434,10 @@ bar <div>baz</div>
 Templates: P-wrapping: 1d. Template preceded by comment-only line
 !!options
 parsoid
 Templates: P-wrapping: 1d. Template preceded by comment-only line
 !!options
 parsoid
-!!input
+!! wikitext
 <!-- foo -->
 {{echo|Bar}}
 <!-- foo -->
 {{echo|Bar}}
-!!result
+!! html
 <!-- foo -->
 
 <p about="#mwt223" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"Bar"}},"i":0}}]}'>Bar</p>
 <!-- foo -->
 
 <p about="#mwt223" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"Bar"}},"i":0}}]}'>Bar</p>
@@ -8430,61 +8445,61 @@ parsoid
 
 !!test
 Templates: Inline Text: 1. Multiple tmeplate uses
 
 !!test
 Templates: Inline Text: 1. Multiple tmeplate uses
-!!input
+!! wikitext
 {{echo|Foo}}bar{{echo|baz}}
 {{echo|Foo}}bar{{echo|baz}}
-!!result
+!! html
 <p>Foobarbaz
 </p>
 !!end
 
 !!test
 Templates: Inline Text: 2. Back-to-back template uses
 <p>Foobarbaz
 </p>
 !!end
 
 !!test
 Templates: Inline Text: 2. Back-to-back template uses
-!!input
+!! wikitext
 {{echo|Foo}}{{echo|bar}}
 {{echo|Foo}}{{echo|bar}}
-!!result
+!! html
 <p>Foobar
 </p>
 !!end
 
 !!test
 Templates: Block Tags: 1. Multiple template uses
 <p>Foobar
 </p>
 !!end
 
 !!test
 Templates: Block Tags: 1. Multiple template uses
-!!input
+!! wikitext
 {{echo|<div>Foo</div>}}<div>bar</div>{{echo|<div>baz</div>}}
 {{echo|<div>Foo</div>}}<div>bar</div>{{echo|<div>baz</div>}}
-!!result
+!! html
 <div>Foo</div><div>bar</div><div>baz</div>
 
 !!end
 
 !!test
 Templates: Block Tags: 2. Back-to-back template uses
 <div>Foo</div><div>bar</div><div>baz</div>
 
 !!end
 
 !!test
 Templates: Block Tags: 2. Back-to-back template uses
-!!input
+!! wikitext
 {{echo|<div>Foo</div>}}{{echo|<div>bar</div>}}
 {{echo|<div>Foo</div>}}{{echo|<div>bar</div>}}
-!!result
+!! html
 <div>Foo</div><div>bar</div>
 
 !!end
 
 !!test
 Templates: Links: 1. Simple example
 <div>Foo</div><div>bar</div>
 
 !!end
 
 !!test
 Templates: Links: 1. Simple example
-!!input
+!! wikitext
 {{echo|[[Foo|bar]]}}
 {{echo|[[Foo|bar]]}}
-!!result
+!! html
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">bar</a>
 </p>
 !!end
 
 !!test
 Templates: Links: 2. Generation of link href
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">bar</a>
 </p>
 !!end
 
 !!test
 Templates: Links: 2. Generation of link href
-!!input
+!! wikitext
 [[{{echo|Foo}}|bar]]
 [[{{echo|Foo}}|bar]]
-!!result
+!! html
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">bar</a>
 </p>
 !!end
 
 !!test
 Templates: Links: 3. Generation of part of a link href
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">bar</a>
 </p>
 !!end
 
 !!test
 Templates: Links: 3. Generation of part of a link href
-!!input
+!! wikitext
 [[Fo{{echo|o}}|bar]]
 
 [[Foo{{echo|bar}}]]
 [[Fo{{echo|o}}|bar]]
 
 [[Foo{{echo|bar}}]]
@@ -8496,7 +8511,7 @@ Templates: Links: 3. Generation of part of a link href
 [[:Foo{{echo|bar}}]]
 
 [[:Foo{{echo|bar}}|bar]]
 [[:Foo{{echo|bar}}]]
 
 [[:Foo{{echo|bar}}|bar]]
-!!result
+!! html
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">bar</a>
 </p><p><a href="/index.php?title=Foobar&amp;action=edit&amp;redlink=1" class="new" title="Foobar (page does not exist)">Foobar</a>
 </p><p><a href="/index.php?title=Foobarbaz&amp;action=edit&amp;redlink=1" class="new" title="Foobarbaz (page does not exist)">Foobarbaz</a>
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">bar</a>
 </p><p><a href="/index.php?title=Foobar&amp;action=edit&amp;redlink=1" class="new" title="Foobar (page does not exist)">Foobar</a>
 </p><p><a href="/index.php?title=Foobarbaz&amp;action=edit&amp;redlink=1" class="new" title="Foobarbaz (page does not exist)">Foobarbaz</a>
@@ -8508,180 +8523,180 @@ Templates: Links: 3. Generation of part of a link href
 
 !!test
 Templates: Links: 4. Multiple templates generating link href
 
 !!test
 Templates: Links: 4. Multiple templates generating link href
-!!input
+!! wikitext
 [[{{echo|F}}{{echo|o}}ob{{echo|ar}}]]
 [[{{echo|F}}{{echo|o}}ob{{echo|ar}}]]
-!!result
+!! html
 <p><a href="/index.php?title=Foobar&amp;action=edit&amp;redlink=1" class="new" title="Foobar (page does not exist)">Foobar</a>
 </p>
 !!end
 
 !!test
 Templates: Links: 5. Generation of link text
 <p><a href="/index.php?title=Foobar&amp;action=edit&amp;redlink=1" class="new" title="Foobar (page does not exist)">Foobar</a>
 </p>
 !!end
 
 !!test
 Templates: Links: 5. Generation of link text
-!!input
+!! wikitext
 [[Foo|{{echo|bar}}]]
 [[Foo|{{echo|bar}}]]
-!!result
+!! html
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">bar</a>
 </p>
 !!end
 
 !!test
 Templates: Links: 5. Nested templates (only outermost template should be marked)
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">bar</a>
 </p>
 !!end
 
 !!test
 Templates: Links: 5. Nested templates (only outermost template should be marked)
-!!input
+!! wikitext
 {{echo|[[{{echo|Foo}}|bar]]}}
 {{echo|[[{{echo|Foo}}|bar]]}}
-!!result
+!! html
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">bar</a>
 </p>
 !!end
 
 !!test
 Templates: HTML Tag: 1. Generation of HTML attr. key
 <p><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">bar</a>
 </p>
 !!end
 
 !!test
 Templates: HTML Tag: 1. Generation of HTML attr. key
-!!input
+!! wikitext
 <div {{echo|style}}="color:red;">foo</div>
 <div {{echo|style}}="color:red;">foo</div>
-!!result
+!! html
 <div style="color:red;">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 2. Generation of HTML attr. value
 <div style="color:red;">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 2. Generation of HTML attr. value
-!!input
+!! wikitext
 <div style={{echo|'color:red;'}}>foo</div>
 <div style={{echo|'color:red;'}}>foo</div>
-!!result
+!! html
 <div style="color:red;">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 3. Generation of HTML attr key and value
 <div style="color:red;">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 3. Generation of HTML attr key and value
-!!input
+!! wikitext
 <div {{echo|style}}={{echo|'color:red;'}}>foo</div>
 <div {{echo|style}}={{echo|'color:red;'}}>foo</div>
-!!result
+!! html
 <div style="color:red;">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 4. Generation of starting piece of HTML attr value
 <div style="color:red;">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 4. Generation of starting piece of HTML attr value
-!!input
+!! wikitext
 <div title="{{echo|This is a long title}} with just one piece templated">foo</div>
 <div title="{{echo|This is a long title}} with just one piece templated">foo</div>
-!!result
+!! html
 <div title="This is a long title with just one piece templated">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 5. Generation of middle piece of HTML attr value
 <div title="This is a long title with just one piece templated">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 5. Generation of middle piece of HTML attr value
-!!input
+!! wikitext
 <div title="This is a long title with just {{echo|one piece}} templated">foo</div>
 <div title="This is a long title with just {{echo|one piece}} templated">foo</div>
-!!result
+!! html
 <div title="This is a long title with just one piece templated">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 6. Generation of end piece of HTML attr value
 <div title="This is a long title with just one piece templated">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 6. Generation of end piece of HTML attr value
-!!input
+!! wikitext
 <div title="This is a long title with just one piece {{echo|templated}}">foo</div>
 <div title="This is a long title with just one piece {{echo|templated}}">foo</div>
-!!result
+!! html
 <div title="This is a long title with just one piece templated">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 7. Generation of partial attribute key string
 <div title="This is a long title with just one piece templated">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tag: 7. Generation of partial attribute key string
-!!input
+!! wikitext
 <div st{{echo|yle}}="color:red;">foo</div>
 <div st{{echo|yle}}="color:red;">foo</div>
-!!result
+!! html
 <div style="color:red;">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tables: 1. Generating start of a HTML table
 <div style="color:red;">foo</div>
 
 !!end
 
 !!test
 Templates: HTML Tables: 1. Generating start of a HTML table
-!!input
+!! wikitext
 {{echo|<table><tr><td>foo</td>}}</tr></table>
 {{echo|<table><tr><td>foo</td>}}</tr></table>
-!!result
+!! html
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 2a. Generating middle of a HTML table
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 2a. Generating middle of a HTML table
-!!input
+!! wikitext
 <table><tr>{{echo|<td>foo</td>}}</tr></table>
 <table><tr>{{echo|<td>foo</td>}}</tr></table>
-!!result
+!! html
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 2b. Generating middle of a HTML table
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 2b. Generating middle of a HTML table
-!!input
+!! wikitext
 <table>{{echo|<tr><td>foo</td></tr>}}</table>
 <table>{{echo|<tr><td>foo</td></tr>}}</table>
-!!result
+!! html
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 3. Generating end of a HTML table
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 3. Generating end of a HTML table
-!!input
+!! wikitext
 <table><tr>{{echo|<td>foo</td></tr></table>}}
 <table><tr>{{echo|<td>foo</td></tr></table>}}
-!!result
+!! html
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4a. Generating a single tag of a HTML table
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4a. Generating a single tag of a HTML table
-!!input
+!! wikitext
 {{echo|<table>}}<tr><td>foo</td></tr></table>
 {{echo|<table>}}<tr><td>foo</td></tr></table>
-!!result
+!! html
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4b. Generating a single tag of a HTML table
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4b. Generating a single tag of a HTML table
-!!input
+!! wikitext
 <table>{{echo|<tr>}}<td>foo</td></tr></table>
 <table>{{echo|<tr>}}<td>foo</td></tr></table>
-!!result
+!! html
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4c. Generating a single tag of a HTML table
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4c. Generating a single tag of a HTML table
-!!input
+!! wikitext
 <table><tr>{{echo|<td>}}foo</td></tr></table>
 <table><tr>{{echo|<td>}}foo</td></tr></table>
-!!result
+!! html
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4d. Generating a single tag of a HTML table
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4d. Generating a single tag of a HTML table
-!!input
+!! wikitext
 <table><tr><td>foo{{echo|</td>}}</tr></table>
 <table><tr><td>foo{{echo|</td>}}</tr></table>
-!!result
+!! html
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4e. Generating a single tag of a HTML table
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4e. Generating a single tag of a HTML table
-!!input
+!! wikitext
 <table><tr><td>foo</td>{{echo|</tr>}}</table>
 <table><tr><td>foo</td>{{echo|</tr>}}</table>
-!!result
+!! html
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4f. Generating a single tag of a HTML table
 <table><tr><td>foo</td></tr></table>
 
 !!end
 
 !!test
 Templates: HTML Tables: 4f. Generating a single tag of a HTML table
-!!input
+!! wikitext
 <table><tr><td>foo</td></tr>{{echo|</table>}}
 <table><tr><td>foo</td></tr>{{echo|</table>}}
-!!result
+!! html
 <table><tr><td>foo</td></tr></table>
 
 !!end
 <table><tr><td>foo</td></tr></table>
 
 !!end
@@ -8690,11 +8705,11 @@ Templates: HTML Tables: 4f. Generating a single tag of a HTML table
 Templates: HTML Tables: 5. Proper fostering of categories from inside
 !!options
 parsoid=wt2html,wt2wt
 Templates: HTML Tables: 5. Proper fostering of categories from inside
 !!options
 parsoid=wt2html,wt2wt
-!!input
+!! wikitext
 <table>[[Category:foo1]]<tr><td>foo</td></tr></table>
 <!--Two categories (Bug 50330)-->
 <table>[[Category:bar1]][[Category:bar2]]<tr><td>foo</td></tr></table>
 <table>[[Category:foo1]]<tr><td>foo</td></tr></table>
 <!--Two categories (Bug 50330)-->
 <table>[[Category:bar1]][[Category:bar2]]<tr><td>foo</td></tr></table>
-!!result
+!! html
 <link rel="mw:PageProp/Category" href="./Category:Foo1"><table><tbody><tr><td>foo</td></tr></tbody></table>
 <!--Two categories (Bug 50330)-->
 <link rel="mw:PageProp/Category" href="./Category:Bar1"><link rel="mw:PageProp/Category" href="./Category:Bar2"><table><tbody><tr><td>foo</td></tr></tbody></table>
 <link rel="mw:PageProp/Category" href="./Category:Foo1"><table><tbody><tr><td>foo</td></tr></tbody></table>
 <!--Two categories (Bug 50330)-->
 <link rel="mw:PageProp/Category" href="./Category:Bar1"><link rel="mw:PageProp/Category" href="./Category:Bar2"><table><tbody><tr><td>foo</td></tr></tbody></table>
@@ -8702,11 +8717,11 @@ parsoid=wt2html,wt2wt
 
 !!test
 Templates: Wiki Tables: 1a. Fostering of entire template content
 
 !!test
 Templates: Wiki Tables: 1a. Fostering of entire template content
-!!input
+!! wikitext
 {|
 {{echo|a}}
 |}
 {|
 {{echo|a}}
 |}
-!!result
+!! html
 <table>
 a
 <tr><td></td></tr></table>
 <table>
 a
 <tr><td></td></tr></table>
 
 !!test
 Templates: Wiki Tables: 1b. Fostering of entire template content
 
 !!test
 Templates: Wiki Tables: 1b. Fostering of entire template content
-!!input
+!! wikitext
 {|
 {{echo|<div>}}
 foo
 {{echo|</div>}}
 |}
 {|
 {{echo|<div>}}
 foo
 {{echo|</div>}}
 |}
-!!result
+!! html
 <table>
 <div>
 <p>foo
 <table>
 <div>
 <p>foo
@@ -8733,12 +8748,12 @@ foo
 
 !!test
 Templates: Wiki Tables: 2. Fostering of partial template content
 
 !!test
 Templates: Wiki Tables: 2. Fostering of partial template content
-!!input
+!! wikitext
 {|
 {{echo|a
 <div>b</div>}}
 |}
 {|
 {{echo|a
 <div>b</div>}}
 |}
-!!result
+!! html
 <table>
 a
 <div>b</div>
 <table>
 a
 <div>b</div>
 
 !!test
 Templates: Wiki Tables: 3. td-content via multiple templates
 
 !!test
 Templates: Wiki Tables: 3. td-content via multiple templates
-!!input
+!! wikitext
 {|
 {{echo|{{pipe}}a}}{{echo|b}}
 |}
 {|
 {{echo|{{pipe}}a}}{{echo|b}}
 |}
-!!result
+!! html
 <table>
 <tr>
 <td>ab
 <table>
 <tr>
 <td>ab
@@ -8762,10 +8777,10 @@ Templates: Wiki Tables: 3. td-content via multiple templates
 
 !!test
 Templates: Wiki Tables: 4. Templated tags, no content
 
 !!test
 Templates: Wiki Tables: 4. Templated tags, no content
-!!input
+!! wikitext
 {{tbl-start}}
 {{tbl-end}}
 {{tbl-start}}
 {{tbl-end}}
-!!result
+!! html
 <table>
 <tr><td></td></tr></table>
 
 <table>
 <tr><td></td></tr></table>
 
@@ -8773,11 +8788,11 @@ Templates: Wiki Tables: 4. Templated tags, no content
 
 !!test
 Templates: Wiki Tables: 5. Templated tags, regular td-tags
 
 !!test
 Templates: Wiki Tables: 5. Templated tags, regular td-tags
-!!input
+!! wikitext
 {{tbl-start}}
 |foo
 {{tbl-end}}
 {{tbl-start}}
 |foo
 {{tbl-end}}
-!!result
+!! html
 <table>
 <tr>
 <td>foo
 <table>
 <tr>
 <td>foo
@@ -8787,11 +8802,11 @@ Templates: Wiki Tables: 5. Templated tags, regular td-tags
 
 !!test
 Templates: Wiki Tables: 6. Templated tags, templated td-tags
 
 !!test
 Templates: Wiki Tables: 6. Templated tags, templated td-tags
-!!input
+!! wikitext
 {{tbl-start}}
 {{!}}foo
 {{tbl-end}}
 {{tbl-start}}
 {{!}}foo
 {{tbl-end}}
-!!result
+!! html
 <table>
 <tr>
 <td>foo
 <table>
 <tr>
 <td>foo
@@ -8801,12 +8816,12 @@ Templates: Wiki Tables: 6. Templated tags, templated td-tags
 
 !!test
 Templates: Lists: Multi-line list-items via templates
 
 !!test
 Templates: Lists: Multi-line list-items via templates
-!!input
+!! wikitext
 *{{echo|a {{nonexistent|
 unused}}}}
 *{{echo|b {{nonexistent|
 unused}}}}
 *{{echo|a {{nonexistent|
 unused}}}}
 *{{echo|b {{nonexistent|
 unused}}}}
-!!result
+!! html
 <ul>
 <li>a <a href="/index.php?title=Template:Nonexistent&amp;action=edit&amp;redlink=1" class="new" title="Template:Nonexistent (page does not exist)">Template:Nonexistent</a>
 </li>
 <ul>
 <li>a <a href="/index.php?title=Template:Nonexistent&amp;action=edit&amp;redlink=1" class="new" title="Template:Nonexistent (page does not exist)">Template:Nonexistent</a>
 </li>
@@ -8818,9 +8833,9 @@ unused}}}}
 
 !!test
 Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo)
 
 !!test
 Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo)
-!!input
+!! wikitext
 {{echo|''a}}{{echo|b''c''d}}{{echo|''e}}
 {{echo|''a}}{{echo|b''c''d}}{{echo|''e}}
-!!result
+!! html
 <p><i>ab</i>c<i>d</i>e
 </p>
 !!end
 <p><i>ab</i>c<i>d</i>e
 </p>
 !!end
@@ -8828,11 +8843,9 @@ Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo)
 !!test
 Templates: Ugly nesting: 2. Quotes opened/closed across templates (echo_with_span)
 (PHP parser generates misnested html)
 !!test
 Templates: Ugly nesting: 2. Quotes opened/closed across templates (echo_with_span)
 (PHP parser generates misnested html)
-!! options
-parsoid
-!!input
+!! wikitext
 {{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}}
 {{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}}
-!!result
+!! html/parsoid
 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_span&quot;,&quot;href&quot;:&quot;./Template:Echo_with_span&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;''a&quot;}},&quot;i&quot;:0}}]}"><i>a</i></span><i about="#mwt2" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_span&quot;,&quot;href&quot;:&quot;./Template:Echo_with_span&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;b''c''d&quot;}},&quot;i&quot;:0}},{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_span&quot;,&quot;href&quot;:&quot;./Template:Echo_with_span&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;''e&quot;}},&quot;i&quot;:1}}]}"><span>b</span></i><span about="#mwt2">c</span><i about="#mwt2">d<span></span></i><span about="#mwt2">e</span></p>
 !!end
 
 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_span&quot;,&quot;href&quot;:&quot;./Template:Echo_with_span&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;''a&quot;}},&quot;i&quot;:0}}]}"><i>a</i></span><i about="#mwt2" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_span&quot;,&quot;href&quot;:&quot;./Template:Echo_with_span&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;b''c''d&quot;}},&quot;i&quot;:0}},{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_span&quot;,&quot;href&quot;:&quot;./Template:Echo_with_span&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;''e&quot;}},&quot;i&quot;:1}}]}"><span>b</span></i><span about="#mwt2">c</span><i about="#mwt2">d<span></span></i><span about="#mwt2">e</span></p>
 !!end
 
@@ -8841,9 +8854,9 @@ Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div
 (PHP parser generates misnested html; Parsoid html2wt mode adds newlines between {{echo}}s)
 !! options
 parsoid=wt2html,wt2wt
 (PHP parser generates misnested html; Parsoid html2wt mode adds newlines between {{echo}}s)
 !! options
 parsoid=wt2html,wt2wt
-!!input
+!! wikitext
 {{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}}
 {{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}}
-!!result
+!! html
 <div about="#mwt1" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_div&quot;,&quot;href&quot;:&quot;./Template:Echo_with_div&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;''a&quot;}},&quot;i&quot;:0}}]}"><i>a</i></div>
 <div about="#mwt2" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_div&quot;,&quot;href&quot;:&quot;./Template:Echo_with_div&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;b''c''d&quot;}},&quot;i&quot;:0}}]}"><i>b</i>c<i>d</i></div>
 <div about="#mwt3" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_div&quot;,&quot;href&quot;:&quot;./Template:Echo_with_div&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;''e&quot;}},&quot;i&quot;:0}}]}">e</div>
 <div about="#mwt1" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_div&quot;,&quot;href&quot;:&quot;./Template:Echo_with_div&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;''a&quot;}},&quot;i&quot;:0}}]}"><i>a</i></div>
 <div about="#mwt2" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_div&quot;,&quot;href&quot;:&quot;./Template:Echo_with_div&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;b''c''d&quot;}},&quot;i&quot;:0}}]}"><i>b</i>c<i>d</i></div>
 <div about="#mwt3" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo_with_div&quot;,&quot;href&quot;:&quot;./Template:Echo_with_div&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;''e&quot;}},&quot;i&quot;:0}}]}">e</div>
@@ -8851,9 +8864,9 @@ parsoid=wt2html,wt2wt
 
 !!test
 Templates: Ugly nesting: 4. Divs opened/closed across templates
 
 !!test
 Templates: Ugly nesting: 4. Divs opened/closed across templates
-!!input
+!! wikitext
 a<div>b{{echo|c</div>d}}e
 a<div>b{{echo|c</div>d}}e
-!!result
+!! html
 a<div>bc</div>de
 
 !!end
 a<div>bc</div>de
 
 !!end
@@ -8863,19 +8876,19 @@ Templates: Ugly templates: 1. Navbox template parses badly leading to table misn
 (Parsoid-centric)
 !! options
 parsoid
 (Parsoid-centric)
 !! options
 parsoid
-!!input
+!! wikitext
 {|
 |{{echo|foo</table>}}
 |bar
 |}
 {|
 |{{echo|foo</table>}}
 |bar
 |}
-!!result
+!! html
 <table about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["{|\n|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</table>"}},"i":0}},"\n|bar\n|}"]}'>
 
 <tbody>
 <tr>
 <td>foo</td></tr></tbody></table><span about="#mwt1">
 <table about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["{|\n|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</table>"}},"i":0}},"\n|bar\n|}"]}'>
 
 <tbody>
 <tr>
 <td>foo</td></tr></tbody></table><span about="#mwt1">
-</span><span about="#mwt1">bar</span><span about="#mwt1">
-</span>
+</span><span about="#mwt1">|bar</span><span about="#mwt1">
+|}</span>
 !!end
 
 !!test
 !!end
 
 !!test
@@ -8883,7 +8896,7 @@ Templates: Ugly templates: 2. Navbox template parses badly leading to table misn
 (Parsoid-centric)
 !! options
 parsoid
 (Parsoid-centric)
 !! options
 parsoid
-!!input
+!! wikitext
 <table>
   <tr>
     <td>
 <table>
   <tr>
     <td>
@@ -8903,7 +8916,7 @@ parsoid
     <td>xyz</td>
   </tr>
 </table>
     <td>xyz</td>
   </tr>
 </table>
-!!result
+!! html
 <table about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":["<table>\n  <tr>\n    <td>\n    <table>\n      <tr>\n        <td>1. ",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo </table>"}},"i":0}},"</td>\n        <td> bar </td>\n        <td>2. ",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"baz </table>"}},"i":1}},"</td>\n      </tr>\n      <tr>\n        <td>abc</td>\n      </tr>\n    </table>\n    </td>\n  </tr>\n  <tr>\n    <td>xyz</td>\n  </tr>\n</table>"]}'>
   <tbody><tr>
     <td>
 <table about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":["<table>\n  <tr>\n    <td>\n    <table>\n      <tr>\n        <td>1. ",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo </table>"}},"i":0}},"</td>\n        <td> bar </td>\n        <td>2. ",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"baz </table>"}},"i":1}},"</td>\n      </tr>\n      <tr>\n        <td>abc</td>\n      </tr>\n    </table>\n    </td>\n  </tr>\n  <tr>\n    <td>xyz</td>\n  </tr>\n</table>"]}'>
   <tbody><tr>
     <td>
@@ -8927,10 +8940,10 @@ parsoid
 
 !! test
 Templates: Ugly templates: 3. newline-only template parameter
 
 !! test
 Templates: Ugly templates: 3. newline-only template parameter
-!! input
+!! wikitext
 foo {{echo|
 }}
 foo {{echo|
 }}
-!! result
+!! html
 <p>foo 
 </p>
 !! end
 <p>foo 
 </p>
 !! end
@@ -8938,10 +8951,10 @@ foo {{echo|
 # This looks like a bug: a single newline triggers p/br for some reason.
 !! test
 Templates: Ugly templates: 4. newline-only template parameter inconsistency
 # This looks like a bug: a single newline triggers p/br for some reason.
 !! test
 Templates: Ugly templates: 4. newline-only template parameter inconsistency
-!! input
+!! wikitext
 {{echo|
 }}
 {{echo|
 }}
-!! result
+!! html
 <p><br />
 </p>
 !! end
 <p><br />
 </p>
 !! end
@@ -8949,18 +8962,18 @@ Templates: Ugly templates: 4. newline-only template parameter inconsistency
 
 !!test
 Parser Functions: 1. Simple example
 
 !!test
 Parser Functions: 1. Simple example
-!!input
+!! wikitext
 {{uc:foo}}
 {{uc:foo}}
-!!result
+!! html
 <p>FOO
 </p>
 !!end
 
 !!test
 Parser Functions: 2. Nested use (only outermost should be marked up)
 <p>FOO
 </p>
 !!end
 
 !!test
 Parser Functions: 2. Nested use (only outermost should be marked up)
-!!input
+!! wikitext
 {{uc:{{lc:FOO}}}}
 {{uc:{{lc:FOO}}}}
-!!result
+!! html
 <p>FOO
 </p>
 !!end
 <p>FOO
 </p>
 !!end
@@ -8972,9 +8985,9 @@ Parser Functions: 2. Nested use (only outermost should be marked up)
 pre-save transform: subst:
 !! options
 PST
 pre-save transform: subst:
 !! options
 PST
-!! input
+!! wikitext
 {{subst:test}}
 {{subst:test}}
-!! result
+!! html
 This is a test template
 !! end
 
 This is a test template
 !! end
 
@@ -8982,9 +8995,9 @@ This is a test template
 pre-save transform: normal template
 !! options
 PST
 pre-save transform: normal template
 !! options
 PST
-!! input
+!! wikitext
 {{test}}
 {{test}}
-!! result
+!! html
 {{test}}
 !! end
 
 {{test}}
 !! end
 
@@ -8992,9 +9005,9 @@ PST
 pre-save transform: nonexistent template
 !! options
 PST
 pre-save transform: nonexistent template
 !! options
 PST
-!! input
+!! wikitext
 {{thistemplatedoesnotexist}}
 {{thistemplatedoesnotexist}}
-!! result
+!! html
 {{thistemplatedoesnotexist}}
 !! end
 
 {{thistemplatedoesnotexist}}
 !! end
 
@@ -9003,9 +9016,9 @@ PST
 pre-save transform: subst magic variables
 !! options
 PST
 pre-save transform: subst magic variables
 !! options
 PST
-!! input
+!! wikitext
 {{subst:SITENAME}}
 {{subst:SITENAME}}
-!! result
+!! html
 MediaWiki
 !! end
 
 MediaWiki
 !! end
 
@@ -9014,9 +9027,9 @@ MediaWiki
 pre-save transform: subst: templates with parameters
 !! options
 pst
 pre-save transform: subst: templates with parameters
 !! options
 pst
-!! input
+!! wikitext
 {{subst:paramtest|param="something else"}}
 {{subst:paramtest|param="something else"}}
-!! result
+!! html
 This is a test template with parameter "something else"
 !! end
 
 This is a test template with parameter "something else"
 !! end
 
@@ -9030,9 +9043,9 @@ Template:nowikitest
 pre-save transform: nowiki in subst (bug 1188)
 !! options
 pst
 pre-save transform: nowiki in subst (bug 1188)
 !! options
 pst
-!! input
+!! wikitext
 {{subst:nowikitest}}
 {{subst:nowikitest}}
-!! result
+!! html
 <nowiki>'''not wiki'''</nowiki>
 !! end
 
 <nowiki>'''not wiki'''</nowiki>
 !! end
 
@@ -9047,9 +9060,9 @@ This template has <!-- a comment --> in it.
 pre-save transform: comment in subst (bug 1936)
 !! options
 pst
 pre-save transform: comment in subst (bug 1936)
 !! options
 pst
-!! input
+!! wikitext
 {{subst:commenttest}}
 {{subst:commenttest}}
-!! result
+!! html
 This template has <!-- a comment --> in it.
 !! end
 
 This template has <!-- a comment --> in it.
 !! end
 
@@ -9057,9 +9070,9 @@ This template has <!-- a comment --> in it.
 pre-save transform: unclosed tag
 !! options
 pst noxml
 pre-save transform: unclosed tag
 !! options
 pst noxml
-!! input
+!! wikitext
 <nowiki>'''not wiki'''
 <nowiki>'''not wiki'''
-!! result
+!! html
 <nowiki>'''not wiki'''
 !! end
 
 <nowiki>'''not wiki'''
 !! end
 
@@ -9067,9 +9080,9 @@ pst noxml
 pre-save transform: mixed tag case
 !! options
 pst noxml
 pre-save transform: mixed tag case
 !! options
 pst noxml
-!! input
+!! wikitext
 <NOwiki>'''not wiki'''</noWIKI>
 <NOwiki>'''not wiki'''</noWIKI>
-!! result
+!! html
 <NOwiki>'''not wiki'''</noWIKI>
 !! end
 
 <NOwiki>'''not wiki'''</noWIKI>
 !! end
 
@@ -9077,9 +9090,9 @@ pst noxml
 pre-save transform: unclosed comment in <nowiki>
 !! options
 pst noxml
 pre-save transform: unclosed comment in <nowiki>
 !! options
 pst noxml
-!! input
+!! wikitext
 wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
 wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
-!! result
+!! html
 wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
 !!end
 
 wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
 !!end
 
@@ -9094,9 +9107,9 @@ Template:dangerous
 
 !!test
 (confirming safety of fix for subst bug 1936)
 
 !!test
 (confirming safety of fix for subst bug 1936)
-!! input
+!! wikitext
 {{Template:dangerous}}
 {{Template:dangerous}}
-!! result
+!! html
 <p>@<span>Oh no</span>
 </p>
 !! end
 <p>@<span>Oh no</span>
 </p>
 !! end
@@ -9105,9 +9118,9 @@ Template:dangerous
 pre-save transform: comment containing gallery (bug 5024)
 !! options
 pst
 pre-save transform: comment containing gallery (bug 5024)
 !! options
 pst
-!! input
+!! wikitext
 <!-- <gallery>data</gallery> -->
 <!-- <gallery>data</gallery> -->
-!!result
+!! html
 <!-- <gallery>data</gallery> -->
 !!end
 
 <!-- <gallery>data</gallery> -->
 !!end
 
@@ -9115,9 +9128,9 @@ pst
 pre-save transform: comment containing extension
 !! options
 pst
 pre-save transform: comment containing extension
 !! options
 pst
-!! input
+!! wikitext
 <!-- <tag>data</tag> -->
 <!-- <tag>data</tag> -->
-!!result
+!! html
 <!-- <tag>data</tag> -->
 !!end
 
 <!-- <tag>data</tag> -->
 !!end
 
@@ -9125,9 +9138,9 @@ pst
 pre-save transform: comment containing nowiki
 !! options
 pst
 pre-save transform: comment containing nowiki
 !! options
 pst
-!! input
+!! wikitext
 <!-- <nowiki>data</nowiki> -->
 <!-- <nowiki>data</nowiki> -->
-!!result
+!! html
 <!-- <nowiki>data</nowiki> -->
 !!end
 
 <!-- <nowiki>data</nowiki> -->
 !!end
 
@@ -9135,9 +9148,9 @@ pst
 pre-save transform: <noinclude> in subst (bug 3298)
 !! options
 pst
 pre-save transform: <noinclude> in subst (bug 3298)
 !! options
 pst
-!! input
+!! wikitext
 {{subst:Includes}}
 {{subst:Includes}}
-!! result
+!! html
 Foobar
 !! end
 
 Foobar
 !! end
 
@@ -9145,9 +9158,9 @@ Foobar
 pre-save transform: <onlyinclude> in subst (bug 3298)
 !! options
 pst
 pre-save transform: <onlyinclude> in subst (bug 3298)
 !! options
 pst
-!! input
+!! wikitext
 {{subst:Includes2}}
 {{subst:Includes2}}
-!! result
+!! html
 Foo
 !! end
 
 Foo
 !! end
 
@@ -9167,26 +9180,26 @@ Template:SafeSubstTest
 bug 22297: safesubst: works during PST
 !! options
 pst
 bug 22297: safesubst: works during PST
 !! options
 pst
-!! input
+!! wikitext
 {{subst:SafeSubstTest}}{{safesubst:SubstTest}}
 {{subst:SafeSubstTest}}{{safesubst:SubstTest}}
-!! result
+!! html
 FoobarFoobar
 !! end
 
 !! test
 bug 22297: safesubst: works during normal parse
 FoobarFoobar
 !! end
 
 !! test
 bug 22297: safesubst: works during normal parse
-!! input
+!! wikitext
 {{SafeSubstTest}}
 {{SafeSubstTest}}
-!! result
+!! html
 <p>Foobar
 </p>
 !! end
 
 <p>Foobar
 </p>
 !! end
 
-!! test:
+!! test
 subst: does not work during normal parse
 subst: does not work during normal parse
-!! input
+!! wikitext
 {{SubstTest}}
 {{SubstTest}}
-!! result
+!! html
 <p>{{subst:Includes}}
 </p>
 !! end
 <p>{{subst:Includes}}
 </p>
 !! end
@@ -9195,7 +9208,7 @@ subst: does not work during normal parse
 pre-save transform: context links ("pipe trick")
 !! options
 pst
 pre-save transform: context links ("pipe trick")
 !! options
 pst
-!! input
+!! wikitext
 [[Article (context)|]]
 [[Bar:Article|]]
 [[:Bar:Article|]]
 [[Article (context)|]]
 [[Bar:Article|]]
 [[:Bar:Article|]]
@@ -9205,7 +9218,7 @@ pst
 [[|Article (context)]]
 [[Bar:X (Y) Z|]]
 [[:Bar:X (Y) Z|]]
 [[|Article (context)]]
 [[Bar:X (Y) Z|]]
 [[:Bar:X (Y) Z|]]
-!! result
+!! html
 [[Article (context)|Article]]
 [[Bar:Article|Article]]
 [[:Bar:Article|Article]]
 [[Article (context)|Article]]
 [[Bar:Article|Article]]
 [[:Bar:Article|Article]]
@@ -9221,12 +9234,12 @@ pst
 pre-save transform: context links ("pipe trick") with interwiki prefix
 !! options
 pst
 pre-save transform: context links ("pipe trick") with interwiki prefix
 !! options
 pst
-!! input
+!! wikitext
 [[interwiki:Article|]]
 [[:interwiki:Article|]]
 [[interwiki:Bar:Article|]]
 [[:interwiki:Bar:Article|]]
 [[interwiki:Article|]]
 [[:interwiki:Article|]]
 [[interwiki:Bar:Article|]]
 [[:interwiki:Bar:Article|]]
-!! result
+!! html
 [[interwiki:Article|Article]]
 [[:interwiki:Article|Article]]
 [[interwiki:Bar:Article|Bar:Article]]
 [[interwiki:Article|Article]]
 [[:interwiki:Article|Article]]
 [[interwiki:Bar:Article|Bar:Article]]
@@ -9237,9 +9250,9 @@ pst
 pre-save transform: context links ("pipe trick") with parens in title
 !! options
 pst title=[[Somearticle (context)]]
 pre-save transform: context links ("pipe trick") with parens in title
 !! options
 pst title=[[Somearticle (context)]]
-!! input
+!! wikitext
 [[|Article]]
 [[|Article]]
-!! result
+!! html
 [[Article (context)|Article]]
 !! end
 
 [[Article (context)|Article]]
 !! end
 
@@ -9247,11 +9260,11 @@ pst title=[[Somearticle (context)]]
 pre-save transform: context links ("pipe trick") with comma in title
 !! options
 pst title=[[Someplace, Somewhere]]
 pre-save transform: context links ("pipe trick") with comma in title
 !! options
 pst title=[[Someplace, Somewhere]]
-!! input
+!! wikitext
 [[|Otherplace]]
 [[Otherplace, Elsewhere|]]
 [[Otherplace, Elsewhere, Anywhere|]]
 [[|Otherplace]]
 [[Otherplace, Elsewhere|]]
 [[Otherplace, Elsewhere, Anywhere|]]
-!! result
+!! html
 [[Otherplace, Somewhere|Otherplace]]
 [[Otherplace, Elsewhere|Otherplace]]
 [[Otherplace, Elsewhere, Anywhere|Otherplace]]
 [[Otherplace, Somewhere|Otherplace]]
 [[Otherplace, Elsewhere|Otherplace]]
 [[Otherplace, Elsewhere, Anywhere|Otherplace]]
@@ -9261,10 +9274,10 @@ pst title=[[Someplace, Somewhere]]
 pre-save transform: context links ("pipe trick") with parens and comma
 !! options
 pst title=[[Someplace (IGNORED), Somewhere]]
 pre-save transform: context links ("pipe trick") with parens and comma
 !! options
 pst title=[[Someplace (IGNORED), Somewhere]]
-!! input
+!! wikitext
 [[|Otherplace]]
 [[Otherplace (place), Elsewhere|]]
 [[|Otherplace]]
 [[Otherplace (place), Elsewhere|]]
-!! result
+!! html
 [[Otherplace, Somewhere|Otherplace]]
 [[Otherplace (place), Elsewhere|Otherplace]]
 !! end
 [[Otherplace, Somewhere|Otherplace]]
 [[Otherplace (place), Elsewhere|Otherplace]]
 !! end
@@ -9273,10 +9286,10 @@ pst title=[[Someplace (IGNORED), Somewhere]]
 pre-save transform: context links ("pipe trick") with comma and parens
 !! options
 pst title=[[Who, me? (context)]]
 pre-save transform: context links ("pipe trick") with comma and parens
 !! options
 pst title=[[Who, me? (context)]]
-!! input
+!! wikitext
 [[|Yes, you.]]
 [[Me, Myself, and I (1937 song)|]]
 [[|Yes, you.]]
 [[Me, Myself, and I (1937 song)|]]
-!! result
+!! html
 [[Yes, you. (context)|Yes, you.]]
 [[Me, Myself, and I (1937 song)|Me, Myself, and I]]
 !! end
 [[Yes, you. (context)|Yes, you.]]
 [[Me, Myself, and I (1937 song)|Me, Myself, and I]]
 !! end
@@ -9285,9 +9298,9 @@ pst title=[[Who, me? (context)]]
 pre-save transform: context links ("pipe trick") with namespace
 !! options
 pst title=[[Ns:Somearticle]]
 pre-save transform: context links ("pipe trick") with namespace
 !! options
 pst title=[[Ns:Somearticle]]
-!! input
+!! wikitext
 [[|Article]]
 [[|Article]]
-!! result
+!! html
 [[Ns:Article|Article]]
 !! end
 
 [[Ns:Article|Article]]
 !! end
 
@@ -9295,9 +9308,9 @@ pst title=[[Ns:Somearticle]]
 pre-save transform: context links ("pipe trick") with namespace and parens
 !! options
 pst title=[[Ns:Somearticle (context)]]
 pre-save transform: context links ("pipe trick") with namespace and parens
 !! options
 pst title=[[Ns:Somearticle (context)]]
-!! input
+!! wikitext
 [[|Article]]
 [[|Article]]
-!! result
+!! html
 [[Ns:Article (context)|Article]]
 !! end
 
 [[Ns:Article (context)|Article]]
 !! end
 
@@ -9305,9 +9318,9 @@ pst title=[[Ns:Somearticle (context)]]
 pre-save transform: context links ("pipe trick") with namespace and comma
 !! options
 pst title=[[Ns:Somearticle, Context, Whatever]]
 pre-save transform: context links ("pipe trick") with namespace and comma
 !! options
 pst title=[[Ns:Somearticle, Context, Whatever]]
-!! input
+!! wikitext
 [[|Article]]
 [[|Article]]
-!! result
+!! html
 [[Ns:Article, Context, Whatever|Article]]
 !! end
 
 [[Ns:Article, Context, Whatever|Article]]
 !! end
 
@@ -9315,9 +9328,9 @@ pst title=[[Ns:Somearticle, Context, Whatever]]
 pre-save transform: context links ("pipe trick") with namespace, comma and parens
 !! options
 pst title=[[Ns:Somearticle, Context (context)]]
 pre-save transform: context links ("pipe trick") with namespace, comma and parens
 !! options
 pst title=[[Ns:Somearticle, Context (context)]]
-!! input
+!! wikitext
 [[|Article]]
 [[|Article]]
-!! result
+!! html
 [[Ns:Article (context)|Article]]
 !! end
 
 [[Ns:Article (context)|Article]]
 !! end
 
@@ -9325,9 +9338,9 @@ pst title=[[Ns:Somearticle, Context (context)]]
 pre-save transform: context links ("pipe trick") with namespace, parens and comma
 !! options
 pst title=[[Ns:Somearticle (IGNORED), Context]]
 pre-save transform: context links ("pipe trick") with namespace, parens and comma
 !! options
 pst title=[[Ns:Somearticle (IGNORED), Context]]
-!! input
+!! wikitext
 [[|Article]]
 [[|Article]]
-!! result
+!! html
 [[Ns:Article, Context|Article]]
 !! end
 
 [[Ns:Article, Context|Article]]
 !! end
 
@@ -9335,14 +9348,14 @@ pst title=[[Ns:Somearticle (IGNORED), Context]]
 pre-save transform: context links ("pipe trick") with full-width parens and no space (Japanese and Chinese style, bug 30149)
 !! options
 pst
 pre-save transform: context links ("pipe trick") with full-width parens and no space (Japanese and Chinese style, bug 30149)
 !! options
 pst
-!! input
+!! wikitext
 [[Article(context)|]]
 [[Bar:Article(context)|]]
 [[:Bar:Article(context)|]]
 [[|Article(context)]]
 [[Bar:X(Y)Z|]]
 [[:Bar:X(Y)Z|]]
 [[Article(context)|]]
 [[Bar:Article(context)|]]
 [[:Bar:Article(context)|]]
 [[|Article(context)]]
 [[Bar:X(Y)Z|]]
 [[:Bar:X(Y)Z|]]
-!! result
+!! html
 [[Article(context)|Article]]
 [[Bar:Article(context)|Article]]
 [[:Bar:Article(context)|Article]]
 [[Article(context)|Article]]
 [[Bar:Article(context)|Article]]
 [[:Bar:Article(context)|Article]]
@@ -9355,14 +9368,14 @@ pst
 pre-save transform: context links ("pipe trick") with full-width parens and space (Japanese and Chinese style, bug 30149)
 !! options
 pst
 pre-save transform: context links ("pipe trick") with full-width parens and space (Japanese and Chinese style, bug 30149)
 !! options
 pst
-!! input
+!! wikitext
 [[Article (context)|]]
 [[Bar:Article (context)|]]
 [[:Bar:Article (context)|]]
 [[|Article (context)]]
 [[Bar:X (Y) Z|]]
 [[:Bar:X (Y) Z|]]
 [[Article (context)|]]
 [[Bar:Article (context)|]]
 [[:Bar:Article (context)|]]
 [[|Article (context)]]
 [[Bar:X (Y) Z|]]
 [[:Bar:X (Y) Z|]]
-!! result
+!! html
 [[Article (context)|Article]]
 [[Bar:Article (context)|Article]]
 [[:Bar:Article (context)|Article]]
 [[Article (context)|Article]]
 [[Bar:Article (context)|Article]]
 [[:Bar:Article (context)|Article]]
@@ -9375,14 +9388,14 @@ pst
 pre-save transform: context links ("pipe trick") with parens and no space (Korean style, bug 30149)
 !! options
 pst
 pre-save transform: context links ("pipe trick") with parens and no space (Korean style, bug 30149)
 !! options
 pst
-!! input
+!! wikitext
 [[Article(context)|]]
 [[Bar:Article(context)|]]
 [[:Bar:Article(context)|]]
 [[|Article(context)]]
 [[Bar:X(Y)Z|]]
 [[:Bar:X(Y)Z|]]
 [[Article(context)|]]
 [[Bar:Article(context)|]]
 [[:Bar:Article(context)|]]
 [[|Article(context)]]
 [[Bar:X(Y)Z|]]
 [[:Bar:X(Y)Z|]]
-!! result
+!! html
 [[Article(context)|Article]]
 [[Bar:Article(context)|Article]]
 [[:Bar:Article(context)|Article]]
 [[Article(context)|Article]]
 [[Bar:Article(context)|Article]]
 [[:Bar:Article(context)|Article]]
@@ -9395,14 +9408,14 @@ pst
 pre-save transform: context links ("pipe trick") with commas (bug 21660)
 !! options
 pst
 pre-save transform: context links ("pipe trick") with commas (bug 21660)
 !! options
 pst
-!! input
+!! wikitext
 [[Article (context), context|]]
 [[Article (context),context|]]
 [[Bar:Article (context), context|]]
 [[Bar:Article (context),context|]]
 [[:Bar:Article (context), context|]]
 [[:Bar:Article (context),context|]]
 [[Article (context), context|]]
 [[Article (context),context|]]
 [[Bar:Article (context), context|]]
 [[Bar:Article (context),context|]]
 [[:Bar:Article (context), context|]]
 [[:Bar:Article (context),context|]]
-!! result
+!! html
 [[Article (context), context|Article]]
 [[Article (context),context|Article]]
 [[Bar:Article (context), context|Article]]
 [[Article (context), context|Article]]
 [[Article (context),context|Article]]
 [[Bar:Article (context), context|Article]]
@@ -9415,13 +9428,13 @@ pst
 pre-save transform: trim trailing empty lines
 !! options
 pst
 pre-save transform: trim trailing empty lines
 !! options
 pst
-!! input
+!! wikitext
 Empty lines are trimmed
 
 
 
 
 Empty lines are trimmed
 
 
 
 
-!! result
+!! html
 Empty lines are trimmed
 !! end
 
 Empty lines are trimmed
 !! end
 
@@ -9429,12 +9442,12 @@ Empty lines are trimmed
 pre-save transform: Signature expansion
 !! options
 pst
 pre-save transform: Signature expansion
 !! options
 pst
-!! input
+!! wikitext
 * ~~~
 * <noinclude>~~~</noinclude>
 * <includeonly>~~~</includeonly>
 * <onlyinclude>~~~</onlyinclude>
 * ~~~
 * <noinclude>~~~</noinclude>
 * <includeonly>~~~</includeonly>
 * <onlyinclude>~~~</onlyinclude>
-!! result
+!! html
 * [[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>
 * [[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>
@@ -9446,7 +9459,7 @@ pst
 pre-save transform: Signature expansion in nowiki tags (bug 93)
 !! options
 pst disabled
 pre-save transform: Signature expansion in nowiki tags (bug 93)
 !! options
 pst disabled
-!! input
+!! wikitext
 Shall not expand:
 
 <nowiki>~~~~</nowiki>
 Shall not expand:
 
 <nowiki>~~~~</nowiki>
@@ -9465,7 +9478,7 @@ As well as inside noinclude/onlyinclude
 
 But not inside includeonly
 <includeonly>{{subst:Foo}}</includeonly>
 
 But not inside includeonly
 <includeonly>{{subst:Foo}}</includeonly>
-!! result
+!! html
 Shall not expand:
 
 <nowiki>~~~~</nowiki>
 Shall not expand:
 
 <nowiki>~~~~</nowiki>
@@ -9490,7 +9503,7 @@ But not inside includeonly
 Parsoid: Recognize nowiki with trailing space in tags
 !! options
 parsoid=wt2html
 Parsoid: Recognize nowiki with trailing space in tags
 !! options
 parsoid=wt2html
-!! input
+!! wikitext
 <nowiki ><div>[[foo]]</nowiki >
 
 a<nowiki / >b
 <nowiki ><div>[[foo]]</nowiki >
 
 a<nowiki / >b
@@ -9498,7 +9511,7 @@ a<nowiki / >b
 c<nowiki />d
 
 e<nowiki/ >f
 c<nowiki />d
 
 e<nowiki/ >f
-!! result
+!! html
 <p><span typeof="mw:Nowiki">&lt;div&gt;[[foo]]</span></p>
 <p>ab</p>
 <p>cd</p>
 <p><span typeof="mw:Nowiki">&lt;div&gt;[[foo]]</span></p>
 <p>ab</p>
 <p>cd</p>
@@ -9509,9 +9522,9 @@ e<nowiki/ >f
 Parsoid: Recognize nowiki with odd capitalization
 !! options
 parsoid=wt2html
 Parsoid: Recognize nowiki with odd capitalization
 !! options
 parsoid=wt2html
-!! input
+!! wikitext
 <noWikI ><div>[[foo]]</Nowiki >
 <noWikI ><div>[[foo]]</Nowiki >
-!! result
+!! html
 <p><span typeof="mw:Nowiki">&lt;div&gt;[[foo]]</span></p>
 !! end
 
 <p><span typeof="mw:Nowiki">&lt;div&gt;[[foo]]</span></p>
 !! end
 
@@ -9520,13 +9533,13 @@ parsoid=wt2html
 Parsoid: Escape nowiki with trailing space in tags
 !! options
 parsoid=html2wt
 Parsoid: Escape nowiki with trailing space in tags
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 &lt;nowiki &gt; foo &lt;/nowiki &gt;
 
 a&lt;nowiki /&gt;b
 
 c&lt;nowiki/ &gt;d
 &lt;nowiki &gt; foo &lt;/nowiki &gt;
 
 a&lt;nowiki /&gt;b
 
 c&lt;nowiki/ &gt;d
-!! result
+!! html
 <p>&lt;nowiki &gt; foo &lt/nowiki ></p>
 <p>a&lt;nowiki /&gt;b</p>
 <p>c&lt;nowiki/ &gt;d</p>
 <p>&lt;nowiki &gt; foo &lt/nowiki ></p>
 <p>a&lt;nowiki /&gt;b</p>
 <p>c&lt;nowiki/ &gt;d</p>
@@ -9536,9 +9549,9 @@ c&lt;nowiki/ &gt;d
 Parsoid: Escape weird noWikI capitalizations
 !! options
 parsoid=html2wt
 Parsoid: Escape weird noWikI capitalizations
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 &lt;noWikI &gt; foo &lt;/NoWikI &gt;
 &lt;noWikI &gt; foo &lt;/NoWikI &gt;
-!! result
+!! html
 <p>&lt;noWikI &gt; foo &lt/NoWikI ></p>
 !! end
 
 <p>&lt;noWikI &gt; foo &lt/NoWikI ></p>
 !! end
 
@@ -9549,9 +9562,9 @@ parsoid=html2wt
 message transform: magic variables
 !! options
 msg
 message transform: magic variables
 !! options
 msg
-!! input
+!! wikitext
 {{SITENAME}}
 {{SITENAME}}
-!! result
+!! html
 MediaWiki
 !! end
 
 MediaWiki
 !! end
 
@@ -9559,9 +9572,9 @@ MediaWiki
 message transform: should not transform wiki markup
 !! options
 msg
 message transform: should not transform wiki markup
 !! options
 msg
-!! input
+!! wikitext
 ''test''
 ''test''
-!! result
+!! html
 ''test''
 !! end
 
 ''test''
 !! end
 
@@ -9569,9 +9582,9 @@ msg
 message transform: <noinclude> in transcluded template (bug 4926)
 !! options
 msg
 message transform: <noinclude> in transcluded template (bug 4926)
 !! options
 msg
-!! input
+!! wikitext
 {{Includes}}
 {{Includes}}
-!! result
+!! html
 Foobar
 !! end
 
 Foobar
 !! end
 
@@ -9579,9 +9592,9 @@ Foobar
 message transform: <onlyinclude> in transcluded template (bug 4926)
 !! options
 msg
 message transform: <onlyinclude> in transcluded template (bug 4926)
 !! options
 msg
-!! input
+!! wikitext
 {{Includes2}}
 {{Includes2}}
-!! result
+!! html
 Foo
 !! end
 
 Foo
 !! end
 
@@ -9589,9 +9602,9 @@ Foo
 {{#special:}} page name, known
 !! options
 msg
 {{#special:}} page name, known
 !! options
 msg
-!! input
+!! wikitext
 {{#special:Recentchanges}}
 {{#special:Recentchanges}}
-!! result
+!! html
 Special:RecentChanges
 !! end
 
 Special:RecentChanges
 !! end
 
@@ -9599,9 +9612,9 @@ Special:RecentChanges
 {{#special:}} page name with subpage, known
 !! options
 msg
 {{#special:}} page name with subpage, known
 !! options
 msg
-!! input
+!! wikitext
 {{#special:Recentchanges/param}}
 {{#special:Recentchanges/param}}
-!! result
+!! html
 Special:RecentChanges/param
 !! end
 
 Special:RecentChanges/param
 !! end
 
@@ -9609,9 +9622,9 @@ Special:RecentChanges/param
 {{#special:}} page name, unknown
 !! options
 msg
 {{#special:}} page name, unknown
 !! options
 msg
-!! input
+!! wikitext
 {{#special:foobar nonexistent}}
 {{#special:foobar nonexistent}}
-!! result
+!! html
 Special:Foobar nonexistent
 !! end
 
 Special:Foobar nonexistent
 !! end
 
@@ -9619,9 +9632,9 @@ Special:Foobar nonexistent
 {{#speciale:}} page name, known
 !! options
 msg
 {{#speciale:}} page name, known
 !! options
 msg
-!! input
+!! wikitext
 {{#speciale:Recentchanges}}
 {{#speciale:Recentchanges}}
-!! result
+!! html
 Special:RecentChanges
 !! end
 
 Special:RecentChanges
 !! end
 
@@ -9629,9 +9642,9 @@ Special:RecentChanges
 {{#speciale:}} page name with subpage, known
 !! options
 msg
 {{#speciale:}} page name with subpage, known
 !! options
 msg
-!! input
+!! wikitext
 {{#speciale:Recentchanges/param}}
 {{#speciale:Recentchanges/param}}
-!! result
+!! html
 Special:RecentChanges/param
 !! end
 
 Special:RecentChanges/param
 !! end
 
@@ -9639,9 +9652,9 @@ Special:RecentChanges/param
 {{#speciale:}} page name, unknown
 !! options
 msg
 {{#speciale:}} page name, unknown
 !! options
 msg
-!! input
+!! wikitext
 {{#speciale:foobar nonexistent}}
 {{#speciale:foobar nonexistent}}
-!! result
+!! html
 Special:Foobar_nonexistent
 !! end
 
 Special:Foobar_nonexistent
 !! end
 
@@ -9652,617 +9665,727 @@ Special:Foobar_nonexistent
 #### http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images
 
 !! test
 #### http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images
 
 !! test
-Simple image (php)
+Simple image
 !! options
 !! options
-php
-!! input
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
 [[Image:foobar.jpg]]
 [[Image:foobar.jpg]]
-!! result
+!! html/php
 <p><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>
 </p>
 <p><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>
 </p>
-!! end
-
-!! test
-Simple image (parsoid)
-!! options
-parsoid=wt2html
-!! input
-[[Image:foobar.jpg]]
-!! result
+!! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span>
 </p>
 !! end
 
 !! test
 <p><span class="mw-default-size" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span>
 </p>
 !! end
 
 !! test
-Simple image (using File: namespace, now canonical) (php)
-!! options
-php
-!! input
-[[File:foobar.jpg]]
-!! result
+Simple image (using File: namespace, now canonical)
+!! wikitext
+[[File:Foobar.jpg]]
+!! html/php
 <p><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>
 </p>
 <p><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>
 </p>
-!! end
-
-!! test
-Simple image (using File: namespace, now canonical) (parsoid)
-!! options
-parsoid
-!! input
-[[File:Foobar.jpg]]
-!! result
+!! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span>
 </p>
 !! end
 
 !! test
 <p><span class="mw-default-size" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span>
 </p>
 !! end
 
 !! test
-Right-aligned image (php)
-!! options
-php
-!! input
-[[Image:foobar.jpg|right]]
-!! result
+Right-aligned image
+!! wikitext
+[[File:Foobar.jpg|right]]
+!! html/php
 <div class="floatright"><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></div>
 
 <div class="floatright"><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></div>
 
-!! end
-
-!! test
-Right-aligned image (parsoid)
-!! options
-parsoid
-!! input
-[[File:Foobar.jpg|right]]
-!! result
+!! html/parsoid
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></figure>
 !! end
 
 !! test
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></figure>
 !! end
 
 !! test
-Image with caption (php)
-!! options
-php
-!! input
+Image with caption
+!! wikitext
 [[File:Foobar.jpg|right|Caption text]]
 [[File:Foobar.jpg|right|Caption text]]
-!! result
+!! html/php
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
 
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
 
-!! end
-
-!! test
-Image with caption (parsoid)
-!! options
-parsoid
-!! input
-[[File:Foobar.jpg|right|Caption text]]
-!! result
+!! html/parsoid
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption text</figcaption></figure>
 !! end
 
 !! test
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption text</figcaption></figure>
 !! end
 
 !! test
-Image with caption, bug 53312 #1 (parsoid)
-!! options
-parsoid
-!! input
+Image with caption, bug 53312 #1
+!! wikitext
 [[File:Foobar.jpg|right|Caption page stuff]]
 [[File:Foobar.jpg|right|Caption page stuff]]
-!! result
+!! html/php
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption page stuff"><img alt="Caption page stuff" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
+
+!! html/parsoid
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption page stuff</figcaption></figure>
 !! end
 
 !! test
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption page stuff</figcaption></figure>
 !! end
 
 !! test
-Image with caption, bug 53312 #2 (parsoid)
-!! options
-parsoid
-!! input
+Image with caption, bug 53312 #2
+!! wikitext
 [[File:Foobar.jpg|right|Caption page=]]
 [[File:Foobar.jpg|right|Caption page=]]
-!! result
+!! html/php
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption page="><img alt="Caption page=" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
+
+!! html/parsoid
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption page=</figcaption></figure>
 !! end
 
 !! test
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption page=</figcaption></figure>
 !! end
 
 !! test
-Image with caption, bug 53312 #3 (parsoid)
-!! options
-parsoid
-!! input
+Image with caption, bug 53312 #3
+!! wikitext
 [[File:Foobar.jpg|right|Caption page=stuff]]
 [[File:Foobar.jpg|right|Caption page=stuff]]
-!! result
+!! html/php
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption page=stuff"><img alt="Caption page=stuff" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
+
+!! html/parsoid
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption page=stuff</figcaption></figure>
 !! end
 
 !! test
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption page=stuff</figcaption></figure>
 !! end
 
 !! test
-Image with empty attribute (php)
-!! options
-php
-!! input
-[[File:Foobar.jpg|right||Caption text]]
-!! result
-<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
+Allow empty links in image captions (Bug 60753)
+!! wikitext
+[[File:Foobar.jpg|thumb|Caption [[Link1]]
+[[]]
+[[Link2]]
+]]
+!! html/php
+<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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>Caption <a href="/index.php?title=Link1&amp;action=edit&amp;redlink=1" class="new" title="Link1 (page does not exist)">Link1</a> [[]] <a href="/index.php?title=Link2&amp;action=edit&amp;redlink=1" class="new" title="Link2 (page does not exist)">Link2</a></div></div></div>
+
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"Caption [[Link1]]\n[[]]\n[[Link2]]\n"}],"dsr":[0,59,2,2]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"dsr":[2,null,null,null]}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" height="25" width="220" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption data-parsoid='{"dsr":[null,57,null,null]}'>Caption <a rel="mw:WikiLink" href="./Link1" data-parsoid='{"stx":"simple","a":{"href":"./Link1"},"sa":{"href":"Link1"},"dsr":[32,41,2,2]}'>Link1</a>
+[[]]
+<a rel="mw:WikiLink" href="./Link2" data-parsoid='{"stx":"simple","a":{"href":"./Link2"},"sa":{"href":"Link2"},"dsr":[47,56,2,2]}'>Link2</a>
+</figcaption></figure>
+!! end
 
 
+!! test
+Link with empty target
+!! wikitext
+[[]]
+!! html
+<p>[[]]
+</p>
 !! end
 
 !! test
 !! end
 
 !! test
-Image with empty attribute (parsoid)
+Image with empty attribute
 !! options
 !! options
-parsoid=wt2html
-!! input
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
 [[File:Foobar.jpg|right||Caption text]]
 [[File:Foobar.jpg|right||Caption text]]
-!! result
+!! html/php
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
+
+!! html/parsoid
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption text</figcaption></figure>
 !! end
 
 !! test
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption text</figcaption></figure>
 !! end
 
 !! test
-Image with attributes from template (php)
-!! options
-php
-!! input
-[[File:Foobar.jpg|{{image_attribs}}]]
-!! result
-<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
+1. Block image with individual attributes from templates
+!! wikitext
+[[File:Foobar.jpg|thumb|{{echo|137px}}|This is a caption]]
+!! html/php
+<div class="thumb tright"><div class="thumbinner" style="width:139px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" width="137" height="16" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/206px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/274px-Foobar.jpg 2x" /></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 caption</div></div></div>
 
 
+!! html/parsoid
+<figure typeof="mw:Image/Thumb mw:ExpandedAttrs" data-mw='{"attribs":[["thumbnail",{"html":"thumb"}],["width",{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-mw=\"{&amp;quot;parts&amp;quot;:[{&amp;quot;template&amp;quot;:{&amp;quot;target&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;echo&amp;quot;,&amp;quot;href&amp;quot;:&amp;quot;./Template:Echo&amp;quot;},&amp;quot;params&amp;quot;:{&amp;quot;1&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;137px&amp;quot;}},&amp;quot;i&amp;quot;:0}}]}\" data-parsoid=\"{&amp;quot;dsr&amp;quot;:[24,38,null,null],&amp;quot;pi&amp;quot;:[[{&amp;quot;k&amp;quot;:&amp;quot;1&amp;quot;,&amp;quot;spc&amp;quot;:[&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;]}]]}\">137px&lt;/span>"}]]}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="16" width="137"/></a><figcaption>This is a caption</figcaption></figure>
 !! end
 
 !! test
 !! end
 
 !! test
-Image with attributes from template (parsoid)
-!! options
-parsoid
-!! input
+2. Block Image with individual attributes from templates
+!! wikitext
+[[File:Foobar.jpg|{{echo|thumb}}|{{echo|137px}}|This is a caption]]
+!! html/php
+<div class="thumb tright"><div class="thumbinner" style="width:139px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" width="137" height="16" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/206px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/274px-Foobar.jpg 2x" /></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 caption</div></div></div>
+
+!! html/parsoid
+<figure typeof="mw:Image/Thumb mw:ExpandedAttrs" data-mw='{"attribs":[["thumbnail",{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-mw=\"{&amp;quot;parts&amp;quot;:[{&amp;quot;template&amp;quot;:{&amp;quot;target&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;echo&amp;quot;,&amp;quot;href&amp;quot;:&amp;quot;./Template:Echo&amp;quot;},&amp;quot;params&amp;quot;:{&amp;quot;1&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;thumb&amp;quot;}},&amp;quot;i&amp;quot;:0}}]}\" data-parsoid=\"{&amp;quot;dsr&amp;quot;:[18,32,null,null],&amp;quot;pi&amp;quot;:[[{&amp;quot;k&amp;quot;:&amp;quot;1&amp;quot;,&amp;quot;spc&amp;quot;:[&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;]}]]}\">thumb&lt;/span>"}],["width",{"html":"&lt;span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-mw=\"{&amp;quot;parts&amp;quot;:[{&amp;quot;template&amp;quot;:{&amp;quot;target&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;echo&amp;quot;,&amp;quot;href&amp;quot;:&amp;quot;./Template:Echo&amp;quot;},&amp;quot;params&amp;quot;:{&amp;quot;1&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;137px&amp;quot;}},&amp;quot;i&amp;quot;:0}}]}\" data-parsoid=\"{&amp;quot;dsr&amp;quot;:[33,47,null,null],&amp;quot;pi&amp;quot;:[[{&amp;quot;k&amp;quot;:&amp;quot;1&amp;quot;,&amp;quot;spc&amp;quot;:[&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;]}]]}\">137px&lt;/span>"}]]}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="16" width="137"/></a><figcaption>This is a caption</figcaption></figure>
+!! end
+
+!! test
+3. Inline image with individual attributes from templates
+!! wikitext
+[[File:Foobar.jpg|{{echo|50px}}]]
+!! html/php
+<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" width="50" height="6" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" /></a>
+</p>
+!! html/parsoid
+<p><span typeof="mw:Image mw:ExpandedAttrs" about="#mwt2" data-mw='{"attribs":[["width",{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-mw=\"{&amp;quot;parts&amp;quot;:[{&amp;quot;template&amp;quot;:{&amp;quot;target&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;echo&amp;quot;,&amp;quot;href&amp;quot;:&amp;quot;./Template:Echo&amp;quot;},&amp;quot;params&amp;quot;:{&amp;quot;1&amp;quot;:{&amp;quot;wt&amp;quot;:&amp;quot;50px&amp;quot;}},&amp;quot;i&amp;quot;:0}}]}\" data-parsoid=\"{&amp;quot;dsr&amp;quot;:[18,31,null,null],&amp;quot;pi&amp;quot;:[[{&amp;quot;k&amp;quot;:&amp;quot;1&amp;quot;,&amp;quot;spc&amp;quot;:[&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;]}]]}\">50px&lt;/span>"}]]}' data-parsoid='{"optList":[{"ck":"width","ak":"{{echo|50px}}"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p>
+!! end
+
+## Parsoid does not provide editing support for images where templates produce multiple image attributes.
+## To signal this, we add a 'mw:Placeholder' type to such images. This could change in the future.
+!! test
+Image with multiple attributes from the same template
+!! wikitext
 [[File:Foobar.jpg|{{image_attribs}}]]
 [[File:Foobar.jpg|{{image_attribs}}]]
-!! result
-<figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption text</figcaption></figure>
+!! html/php
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
+
+!! html/parsoid
+<figure class="mw-default-size mw-halign-right" typeof="mw:Image mw:Placeholder"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption text</figcaption></figure>
 !! end
 
 !! test
 !! end
 
 !! test
-Image with link tails (php)
-!! options
-php
-!! input
+Image with link tails
+!! wikitext
 123[[File:Foobar.jpg]]456
 123[[File:Foobar.jpg|right]]456
 123[[File:Foobar.jpg|thumb]]456
 123[[File:Foobar.jpg]]456
 123[[File:Foobar.jpg|right]]456
 123[[File:Foobar.jpg|thumb]]456
-!! result
+!! html/php
 <p>123<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>456
 </p>
 123<div class="floatright"><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></div>456
 123<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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></div></div></div>456
 
 <p>123<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>456
 </p>
 123<div class="floatright"><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></div>456
 123<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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></div></div></div>456
 
-!! end
-
-!! test
-Image with link tails (parsoid)
-!! options
-parsoid
-!! input
-123[[File:Foobar.jpg]]456
-123[[File:Foobar.jpg|right]]456
-123[[File:Foobar.jpg|thumb]]456
-!! result
+!! html/parsoid
 <p>123<span class="mw-default-size" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span>456</p>
 123<figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></figure>456
 <p>123<span class="mw-default-size" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span>456</p>
 123<figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></figure>456
-123<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" height="20" width="180"></a></figure>456
+123<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" height="25" width="220"></a></figure>456
 !! end
 
 !! test
 !! end
 
 !! test
-Image with multiple captions -- only last one is accepted (php)
-!! options
-php
-!! input
+Image with multiple captions -- only last one is accepted
+!! wikitext
 [[File:Foobar.jpg|right|Caption1 - ignored|[[Caption2]] - ignored|Caption3 - accepted]]
 [[File:Foobar.jpg|right|Caption1 - ignored|[[Caption2]] - ignored|Caption3 - accepted]]
-!! result
+!! html/php
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption3 - accepted"><img alt="Caption3 - accepted" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
 
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption3 - accepted"><img alt="Caption3 - accepted" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
 
+!! html/parsoid
+<figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption3 - accepted</figcaption></figure>
 !! end
 
 !! test
 !! end
 
 !! test
-Image with multiple captions -- only last one is accepted (parsoid)
-!! options
-parsoid
-!! input
-[[File:Foobar.jpg|right|Caption1 - ignored|[[Caption2]] - ignored|Caption3 - accepted]]
-!! result
-<figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a><figcaption>Caption3 - accepted</figcaption></figure>
+Image with multiple widths -- use last
+!! wikitext
+[[File:Foobar.jpg|200px|300px|caption]]
+!! html/php
+<p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" width="300" height="34" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/450px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/600px-Foobar.jpg 2x" /></a>
+</p>
+!! html/parsoid
+<p><span typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="34" width="300"/></a></span></p>
 !! end
 
 !! test
 !! end
 
 !! test
-Image with width attribute at different positions (php)
-!! options
-php
-!! input
-[[File:Foobar.jpg|200px|right|Caption]]
-[[File:Foobar.jpg|right|200px|Caption]]
-[[File:Foobar.jpg|right|Caption|200px]]
-!! result
-<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
-<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
-<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
+Image with multiple alignments -- use first (bug 48664)
+!! wikitext
+[[File:Foobar.jpg|thumb|left|right|center|caption]]
 
 
+[[File:Foobar.jpg|middle|text-top|caption]]
+!! html/php
+<div class="thumb tleft"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>caption</div></div></div>
+<p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" style="vertical-align: middle" /></a>
+</p>
+!! html/parsoid
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>caption</figcaption></figure>
+<p><span class="mw-default-size mw-valign-middle" typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p>
 !! end
 
 !! test
 !! end
 
 !! test
-Image with width attribute at different positions (parsoid)
-!! options
-parsoid
-!! input
+Image with width attribute at different positions
+!! wikitext
 [[File:Foobar.jpg|200px|right|Caption]]
 [[File:Foobar.jpg|right|200px|Caption]]
 [[File:Foobar.jpg|right|Caption|200px]]
 [[File:Foobar.jpg|200px|right|Caption]]
 [[File:Foobar.jpg|right|200px|Caption]]
 [[File:Foobar.jpg|right|Caption|200px]]
-!! result
+!! html/php
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
+
+!! html/parsoid
 <figure class="mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" height="23" width="200"></a><figcaption>Caption</figcaption></figure>
 <figure class="mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" height="23" width="200"></a><figcaption>Caption</figcaption></figure>
 <figure class="mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" height="23" width="200"></a><figcaption>Caption</figcaption></figure>
 !! end
 
 <figure class="mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" height="23" width="200"></a><figcaption>Caption</figcaption></figure>
 <figure class="mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" height="23" width="200"></a><figcaption>Caption</figcaption></figure>
 <figure class="mw-halign-right" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" height="23" width="200"></a><figcaption>Caption</figcaption></figure>
 !! end
 
+# a sad bit of backward-compatibility
 !! test
 !! test
-Image with link parameter, wiki target (php)
+Image with size specified with pxpx (bug 13500, 51628)
 !! options
 !! options
-php
-!! input
-[[File:Foobar.jpg|link=Main Page]]
-!! result
-<p><a href="/wiki/Main_Page" title="Main Page"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|20pxpx]]
+[[File:Foobar.jpg|200x20pxpx]]
+!! html/php
+<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" width="20" height="2" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/30px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/40px-Foobar.jpg 2x" /></a>
+<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/177px-Foobar.jpg" width="177" height="20" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/265px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/353px-Foobar.jpg 2x" /></a>
 </p>
 </p>
+!! html/parsoid
+<p><span typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="2" width="20"/></a></span><span typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="20" width="177"/></a></span></p>
 !! end
 
 !! test
 !! end
 
 !! test
-Image with link parameter, wiki target (parsoid)
-!! options
-parsoid
-!! input
+Image with link parameter, wiki target
+!! wikitext
 [[File:Foobar.jpg|link=Main Page]]
 [[File:Foobar.jpg|link=Main Page]]
-!! result
+!! html/php
+<p><a href="/wiki/Main_Page" title="Main Page"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
+</p>
+!! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Image"><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p>
 !! end
 
 <p><span class="mw-default-size" typeof="mw:Image"><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p>
 !! end
 
+# parsoid bug 49293 (part 1)
 !! test
 !! test
-Image with link parameter, URL target (php)
-!! options
-php
-!! input
+Image with link parameter, URL target
+!! wikitext
 [[File:Foobar.jpg|link=http://example.com/]]
 [[File:Foobar.jpg|link=http://example.com/]]
-!! result
+!! html/php
 <p><a href="http://example.com/" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 <p><a href="http://example.com/" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
-!! end
-
-# parsoid bug 49293 (part 1)
-!! test
-Image with link parameter, URL target (parsoid)
-!! options
-parsoid
-!! input
-[[File:Foobar.jpg|link=http://example.com/]]
-!! result
+!! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Image"><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p>
 !! end
 
 <p><span class="mw-default-size" typeof="mw:Image"><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p>
 !! end
 
+# parsoid bug 49293 (part 2)
 !! test
 !! test
-Image with link parameter, protocol-less URL target (php)
-!! options
-php
-!! input
+Image with link parameter, protocol-less URL target
+!! wikitext
 [[File:Foobar.jpg|link=//example.com/]]
 [[File:Foobar.jpg|link=//example.com/]]
-!! result
+!! html/php
 <p><a href="//example.com/" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 <p><a href="//example.com/" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
-!! end
-
-# parsoid bug 49293 (part 2)
-!! test
-Image with link parameter, protocol-less URL target (parsoid)
-!! options
-parsoid
-!! input
-[[File:Foobar.jpg|link=//example.com/]]
-!! result
+!! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Image"><a href="//example.com/"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p>
 !! end
 
 !! test
 Image with link parameter, wgExternalLinkTarget
 <p><span class="mw-default-size" typeof="mw:Image"><a href="//example.com/"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p>
 !! end
 
 !! test
 Image with link parameter, wgExternalLinkTarget
-!! input
+!! wikitext
 [[Image:foobar.jpg|link=http://example.com/]]
 !! config
 wgExternalLinkTarget='foobar'
 [[Image:foobar.jpg|link=http://example.com/]]
 !! config
 wgExternalLinkTarget='foobar'
-!! result
+!! html
 <p><a href="http://example.com/" target="foobar" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 Image with link parameter, wgNoFollowLinks set to false
 <p><a href="http://example.com/" target="foobar" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 Image with link parameter, wgNoFollowLinks set to false
-!! input
+!! wikitext
 [[Image:foobar.jpg|link=http://example.com/]]
 !! config
 wgNoFollowLinks=false
 [[Image:foobar.jpg|link=http://example.com/]]
 !! config
 wgNoFollowLinks=false
-!! result
+!! html
 <p><a href="http://example.com/"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 Image with link parameter, wgNoFollowDomainExceptions
 <p><a href="http://example.com/"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 Image with link parameter, wgNoFollowDomainExceptions
-!! input
+!! wikitext
 [[Image:foobar.jpg|link=http://example.com/]]
 !! config
 wgNoFollowDomainExceptions='example.com'
 [[Image:foobar.jpg|link=http://example.com/]]
 !! config
 wgNoFollowDomainExceptions='example.com'
-!! result
+!! html
 <p><a href="http://example.com/"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 Image with link parameter, wgExternalLinkTarget, unnamed parameter
 <p><a href="http://example.com/"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 Image with link parameter, wgExternalLinkTarget, unnamed parameter
-!! input
+!! wikitext
 [[Image:foobar.jpg|link=http://example.com/|Title]]
 !! config
 wgExternalLinkTarget='foobar'
 [[Image:foobar.jpg|link=http://example.com/|Title]]
 !! config
 wgExternalLinkTarget='foobar'
-!! result
+!! html
 <p><a href="http://example.com/" title="Title" target="foobar" rel="nofollow"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 <p><a href="http://example.com/" title="Title" target="foobar" rel="nofollow"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
-Image with empty link parameter (php)
-!! options
-php
-!! input
+Image with empty link parameter
+!! wikitext
 [[File:Foobar.jpg|link=]]
 [[File:Foobar.jpg|link=]]
-!! result
+!! html/php
 <p><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" />
 </p>
 <p><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" />
 </p>
-!! end
-
-!! test
-Image with empty link parameter (parsoid)
-!! options
-parsoid
-!! input
-[[File:Foobar.jpg|link=]]
-!! result
+!! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Image"><span><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></span></span></p>
 !! end
 
 !! test
 <p><span class="mw-default-size" typeof="mw:Image"><span><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></span></span></p>
 !! end
 
 !! test
-Image with link parameter (wiki target) and unnamed parameter (php)
-!! options
-php
-!! input
-[[File:Foobar.jpg|link=Main Page|Title]]
-!! result
+Image with link parameter (wiki target) and unnamed parameter
+!! wikitext
+[[File:Foobar.jpg|link=Main_Page|Title]]
+!! html/php
 <p><a href="/wiki/Main_Page" title="Title"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 <p><a href="/wiki/Main_Page" title="Title"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
-!! end
-
-!! test
-Image with link parameter (wiki target) and unnamed parameter (parsoid)
-!! options
-parsoid
-!! input
-[[File:Foobar.jpg|link=Main Page|Title]]
-!! result
+!! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p>
 !! end
 
 !! test
 <p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p>
 !! end
 
 !! test
-Image with link parameter (URL target) and unnamed parameter (php)
-!! options
-php
-!! input
+Image with link parameter (URL target) and unnamed parameter
+!! wikitext
 [[File:Foobar.jpg|link=http://example.com/|Title]]
 [[File:Foobar.jpg|link=http://example.com/|Title]]
-!! result
+!! html/php
 <p><a href="http://example.com/" title="Title" rel="nofollow"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 <p><a href="http://example.com/" title="Title" rel="nofollow"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
-!! end
-
-!! test
-Image with link parameter (URL target) and unnamed parameter (parsoid)
-!! options
-parsoid
-!! input
-[[File:Foobar.jpg|link=http://example.com/|Title]]
-!! result
+!! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p>
 !! end
 
 !! test
 Thumbnail image with link parameter
 !! options
 <p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p>
 !! end
 
 !! test
 Thumbnail image with link parameter
 !! options
-php
-!! input
-[[Image:foobar.jpg|thumb|link=http://example.com/|Title]]
-!! result
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|thumb|link=http://example.com/|Title]]
+!! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="http://example.com/"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>Title</div></div></div>
 
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="http://example.com/"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>Title</div></div></div>
 
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>Title</figcaption></figure>
 !! end
 
 !! test
 Manually-specified thumbnail image
 !! end
 
 !! test
 Manually-specified thumbnail image
-!! options
-php
-!! input
-[[Image:Foobar.jpg|thumb=Thumb.png|Title]]
-!! result
+!! wikitext
+[[File:Foobar.jpg|thumb=Thumb.png|Title]]
+!! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" 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>Title</div></div></div>
 
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" 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>Title</div></div></div>
 
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
 !! end
 
 !! test
 Manually-specified thumbnail image with explicit link to wiki page
 !! options
 !! end
 
 !! test
 Manually-specified thumbnail image with explicit link to wiki page
 !! options
-php
-!! input
-[[Image:Foobar.jpg|thumb=Thumb.png|link=Main Page|Title]]
-!! result
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|thumb=Thumb.png|link=Main_Page|Title]]
+!! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" 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>Title</div></div></div>
 
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" 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>Title</div></div></div>
 
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
 !! end
 
 !! test
 Manually-specified thumbnail image with explicit link to url
 !! options
 !! end
 
 !! test
 Manually-specified thumbnail image with explicit link to url
 !! options
-php
-!! input
-[[Image:Foobar.jpg|thumb=Thumb.png|link=http://example.com|Title]]
-!! result
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|thumb=Thumb.png|link=http://example.com|Title]]
+!! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="http://example.com"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" 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>Title</div></div></div>
 
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="http://example.com"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" 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>Title</div></div></div>
 
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="http://example.com"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
 !! end
 
 !! test
 Manually-specified thumbnail image with explicit no link
 !! options
 !! end
 
 !! test
 Manually-specified thumbnail image with explicit no link
 !! options
-php
-!! input
-[[Image:Foobar.jpg|thumb=Thumb.png|link=|Title]]
-!! result
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|thumb=Thumb.png|link=|Title]]
+!! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" class="thumbimage" />  <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>Title</div></div></div>
 
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" class="thumbimage" />  <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>Title</div></div></div>
 
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><span><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" height="135" width="135"/></span><figcaption>Title</figcaption></figure>
+!! end
+
+!! test
+Manually-specified thumbnail image with explicit link and alt text
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|thumb=Thumb.png|link=Main_Page|alt=alttext|Title]]
+!! html/php
+<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="alttext" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" 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>Title</div></div></div>
+
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="Main_Page"><img alt="alttext" resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
+!! end
+
+!! test
+Image with frame and link
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
+!! html/php
+<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>
+
+!! html/parsoid
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="Main_Page">Main Page</a></figcaption></figure>
+!! end
+
+!! test
+Image with frame and link and explicit alt
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]]
+!! html/php
+<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>
+
+!! html/parsoid
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="File:Foobar.jpg"><img alt="Altitude" resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="Main_Page">Main Page</a></figcaption></figure>
+!! end
+
+!! test
+Image with wiki markup in implicit alt
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[Image:Foobar.jpg|testing '''bold''' in alt]]
+
+[[Image:Foobar.jpg|alt=testing '''bold''' in alt]]
+!! html/php
+<p><a href="/wiki/File:Foobar.jpg" class="image" title="testing bold in alt"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
+</p><p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
+</p>
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Image" data-mw="{&quot;caption&quot;:&quot;testing '''bold''' in alt&quot;}"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p>
+<p><span class="mw-default-size" typeof="mw:Image"><a href="File:Foobar.jpg"><img alt="testing bold in alt" resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p>
+!! end
+
+###################
+# Image sizing.
+# See https://www.mediawiki.org/wiki/Help:Images#Size_and_frame
+# and https://bugzilla.wikimedia.org/show_bug.cgi?id=62258
+# Foobar has actual size of 1941x220
+# 1. Thumbs & frameless always reduce, can't be enlarged
+# 2. Framed images ignore width; always render at default size.
+#    If given a height, they respect height but continue to ignore width.
+# 3. "Unspecified format" and border are the only types which can be
+#    enlarged.
+
+!! test
+Image: "unspecified format" and border enlarge
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|2000px]]
+
+[[File:Foobar.jpg|border|2000px]]
+!! html/php
+<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="2000" height="227" /></a>
+</p><p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="2000" height="227" class="thumbborder" /></a>
+</p>
+!! html/parsoid
+<p><span typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="227" width="2000"/></a></span></p>
+<p><span class="mw-image-border" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="227" width="2000"/></a></span></p>
+!! end
+
+!! test
+Image: "unspecified format" and border reduce
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|1000px]]
+
+[[File:Foobar.jpg|border|1000px]]
+!! html/php
+<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1000px-Foobar.jpg" width="1000" height="113" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/1500px-Foobar.jpg 1.5x, http://example.com/images/3/3a/Foobar.jpg 2x" /></a>
+</p><p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1000px-Foobar.jpg" width="1000" height="113" class="thumbborder" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/1500px-Foobar.jpg 1.5x, http://example.com/images/3/3a/Foobar.jpg 2x" /></a>
+</p>
+!! html/parsoid
+<p><span typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="113" width="1000"/></a></span></p>
+<p><span class="mw-image-border" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="113" width="1000"/></a></span></p>
+!! end
+
+!! test
+Image: thumbs reduce
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|thumb|50px]]
+!! html/php
+<div class="thumb tright"><div class="thumbinner" style="width:52px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" width="50" height="6" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" /></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></div></div></div>
+
+!! html/parsoid
+<figure typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="6" width="50"/></a></figure>
+!! end
+
+!! test
+Image: thumbs can't be enlarged past original size
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|thumb|2000px]]
+!! html/php
+<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><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" 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></div></div></div>
+
+!! html/parsoid
+<figure typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></figure>
 !! end
 
 !! test
 !! end
 
 !! test
-Manually-specified thumbnail image with explicit link and alt text
+Image: frameless can reduce in size
 !! options
 !! options
-php
-!! input
-[[Image:Foobar.jpg|thumb=Thumb.png|link=Main Page|alt=alttext|Title]]
-!! result
-<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="alttext" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" 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>Title</div></div></div>
-
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|frameless|50px]]
+!! html/php
+<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" width="50" height="6" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" /></a>
+</p>
+!! html/parsoid
+<p><span typeof="mw:Image/Frameless"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="6" width="50"/></a></span></p>
 !! end
 
 !! test
 !! end
 
 !! test
-Image with frame and link
-!! 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" title="Main Page">Main Page</a></div></div></div>
-
+Image: frameless can't be enlarged past original size
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|frameless|2000px]]
+!! html/php
+<p><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>
+</p>
+!! html/parsoid
+<p><span typeof="mw:Image/Frameless"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p>
 !! end
 
 !! test
 !! end
 
 !! test
-Image with frame and link and explicit alt
-!! 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" title="Main Page">Main Page</a></div></div></div>
+Image: framed images ignore size if only width is given
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|frame]]
 
 
-!! end
+[[File:Foobar.jpg|frame|50px]]
 
 
-!! test
-Image with wiki markup in implicit alt
-!! input
-[[Image:Foobar.jpg|testing '''bold''' in alt]]
-!! result
-<p><a href="/wiki/File:Foobar.jpg" class="image" title="testing bold in alt"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
-</p>
+[[File:Foobar.jpg|frame|2000px]]
+!! html/php
+<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><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" class="thumbimage" /></a>  <div class="thumbcaption"></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><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" class="thumbimage" /></a>  <div class="thumbcaption"></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><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" class="thumbimage" /></a>  <div class="thumbcaption"></div></div></div>
+
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Frame"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></figure><figure typeof="mw:Image/Frame"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></figure><figure typeof="mw:Image/Frame"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></figure>
 !! end
 
 !! test
 !! end
 
 !! test
-Image with wiki markup in explicit alt
-!! input
-[[Image:Foobar.jpg|alt=testing '''bold''' in alt]]
-!! result
-<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
-</p>
+Image: framed images respect size if given a height, but ignore width.
+!! wikitext
+[[File:Foobar.jpg|frame|50x50px]]
+!! html/php
+<div class="thumb tright"><div class="thumbinner" style="width:444px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/442px-Foobar.jpg" width="442" height="50" class="thumbimage" /></a>  <div class="thumbcaption"></div></div></div>
+
+!! html/parsoid
+<figure typeof="mw:Image/Frame"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="50" width="442"/></a></figure>
 !! end
 
 !! end
 
+###################
+
 !! test
 Link to image page- image page normally doesn't exists, hence edit link
 Add test with existing image page
 #<p><a href="/wiki/File:Test" title="Image:Test">Image:test</a>
 !! test
 Link to image page- image page normally doesn't exists, hence edit link
 Add test with existing image page
 #<p><a href="/wiki/File:Test" title="Image:Test">Image:test</a>
-!! input
+!! wikitext
 [[:Image:test]]
 [[:Image:test]]
-!! result
+!! html
 <p><a href="/index.php?title=File:Test&amp;action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">Image:test</a>
 </p>
 !! end
 
 !! test
 bug 18784  Link to non-existent image page with caption should use caption as link text
 <p><a href="/index.php?title=File:Test&amp;action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">Image:test</a>
 </p>
 !! end
 
 !! test
 bug 18784  Link to non-existent image page with caption should use caption as link text
-!! input
+!! wikitext
 [[:Image:test|caption]]
 [[:Image:test|caption]]
-!! result
+!! html
 <p><a href="/index.php?title=File:Test&amp;action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">caption</a>
 </p>
 !! end
 
 !! test
 Frameless image caption with a free URL
 <p><a href="/index.php?title=File:Test&amp;action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">caption</a>
 </p>
 !! end
 
 !! test
 Frameless image caption with a free URL
-!! input
-[[Image:foobar.jpg|http://example.com]]
-!! result
+!! wikitext
+[[File:Foobar.jpg|http://example.com]]
+!! html/php
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="http://example.com"><img alt="http://example.com" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="http://example.com"><img alt="http://example.com" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"http://example.com"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p>
 !! end
 
 !! test
 Thumbnail image caption with a free URL
 !! end
 
 !! test
 Thumbnail image caption with a free URL
-!! input
-[[Image:foobar.jpg|thumb|http://example.com]]
-!! result
+!! wikitext
+[[File:Foobar.jpg|thumb|http://example.com]]
+!! html/php
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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><a rel="nofollow" class="external free" href="http://example.com">http://example.com</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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div>
 
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption><a rel="mw:ExtLink" href="http://example.com">http://example.com</a></figcaption></figure>
 !! end
 
 !! test
 Thumbnail image caption with a free URL and explicit alt
 !! end
 
 !! test
 Thumbnail image caption with a free URL and explicit alt
-!! input
-[[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]]
-!! result
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|thumb|http://example.com|alt=Alteration]]
+!! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div>
 
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div>
 
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img alt="Alteration" resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption><a rel="mw:ExtLink" href="http://example.com">http://example.com</a></figcaption></figure>
 !! end
 
 !! test
 SVG thumbnails with no language set
 !! options
 !! end
 
 !! test
 SVG thumbnails with no language set
 !! options
-!! input
+!! wikitext
 [[File:Foobar.svg|thumb|caption]]
 [[File:Foobar.svg|thumb|caption]]
-!! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.svg" class="image"><img alt="" src="http://example.com/images/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png" width="180" height="180" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>caption</div></div></div>
+!! html
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.svg" class="image"><img alt="" src="http://example.com/images/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png" width="180" height="135" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>caption</div></div></div>
 
 !! end
 
 !! test
 SVG thumbnails with language de
 !! options
 
 !! end
 
 !! test
 SVG thumbnails with language de
 !! options
-!! input
+!! wikitext
 [[File:Foobar.svg|thumb|caption|lang=de]]
 [[File:Foobar.svg|thumb|caption|lang=de]]
-!! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=File:Foobar.svg&amp;lang=de" class="image"><img alt="" src="http://example.com/images/thumb/f/ff/Foobar.svg/langde-180px-Foobar.svg.png" width="180" height="180" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langde-270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langde-360px-Foobar.svg.png 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>caption</div></div></div>
+!! html
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=File:Foobar.svg&amp;lang=de" class="image"><img alt="" src="http://example.com/images/thumb/f/ff/Foobar.svg/langde-180px-Foobar.svg.png" width="180" height="135" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langde-270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langde-360px-Foobar.svg.png 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>caption</div></div></div>
 
 !! end
 
 !! test
 SVG thumbnails with invalid language code
 !! options
 
 !! end
 
 !! test
 SVG thumbnails with invalid language code
 !! options
-!! input
+!! wikitext
 [[File:Foobar.svg|thumb|caption|lang=invalid.language.code]]
 [[File:Foobar.svg|thumb|caption|lang=invalid.language.code]]
-!! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.svg" class="image"><img alt="" src="http://example.com/images/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png" width="180" height="180" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>lang=invalid.language.code</div></div></div>
+!! html
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.svg" class="image"><img alt="" src="http://example.com/images/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png" width="180" height="135" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>lang=invalid.language.code</div></div></div>
 
 !! end
 
 !! test
 BUG 1887: A ISBN with a thumbnail
 
 !! end
 
 !! test
 BUG 1887: A ISBN with a thumbnail
-!! input
+!! wikitext
 [[Image:foobar.jpg|thumb|ISBN 1235467890]]
 [[Image:foobar.jpg|thumb|ISBN 1235467890]]
-!! result
+!! html
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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><a href="/wiki/Special:BookSources/1235467890" class="internal mw-magiclink-isbn">ISBN 1235467890</a></div></div></div>
 
 !! end
 
 !! test
 BUG 1887: A RFC with a thumbnail
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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><a href="/wiki/Special:BookSources/1235467890" class="internal mw-magiclink-isbn">ISBN 1235467890</a></div></div></div>
 
 !! end
 
 !! test
 BUG 1887: A RFC with a thumbnail
-!! input
+!! wikitext
 [[Image:foobar.jpg|thumb|This is RFC 12354]]
 [[Image:foobar.jpg|thumb|This is RFC 12354]]
-!! result
+!! html
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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" rel="nofollow" href="//tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div>
 
 !! end
 
 !! test
 BUG 1887: A mailto link with a thumbnail
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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" rel="nofollow" href="//tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div>
 
 !! end
 
 !! test
 BUG 1887: A mailto link with a thumbnail
-!! input
+!! wikitext
 [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]]
 [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]]
-!! result
+!! html
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>Please <a rel="nofollow" class="external free" href="mailto:nobody@example.com">mailto:nobody@example.com</a></div></div></div>
 
 !! end
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>Please <a rel="nofollow" class="external free" href="mailto:nobody@example.com">mailto:nobody@example.com</a></div></div></div>
 
 !! end
@@ -10270,82 +10393,82 @@ BUG 1887: A mailto link with a thumbnail
 # Pending resolution to bug 368
 !! test
 BUG 648: Frameless image caption with a link
 # Pending resolution to bug 368
 !! test
 BUG 648: Frameless image caption with a link
-!! input
+!! wikitext
 [[Image:foobar.jpg|text with a [[link]] in it]]
 [[Image:foobar.jpg|text with a [[link]] in it]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 BUG 648: Frameless image caption with a link (suffix)
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 BUG 648: Frameless image caption with a link (suffix)
-!! input
+!! wikitext
 [[Image:foobar.jpg|text with a [[link]]foo in it]]
 [[Image:foobar.jpg|text with a [[link]]foo in it]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a linkfoo in it"><img alt="text with a linkfoo in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 BUG 648: Frameless image caption with an interwiki link
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a linkfoo in it"><img alt="text with a linkfoo in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 BUG 648: Frameless image caption with an interwiki link
-!! input
+!! wikitext
 [[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]]
 [[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a MeatBall:Link in it"><img alt="text with a MeatBall:Link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 BUG 648: Frameless image caption with a piped interwiki link
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a MeatBall:Link in it"><img alt="text with a MeatBall:Link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 BUG 648: Frameless image caption with a piped interwiki link
-!! input
+!! wikitext
 [[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]]
 [[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 Escape HTML special chars in image alt text
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 Escape HTML special chars in image alt text
-!! input
+!! wikitext
 [[Image:foobar.jpg|& < > "]]
 [[Image:foobar.jpg|& < > "]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="&amp; &lt; &gt; &quot;"><img alt="&amp; &lt; &gt; &quot;" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 BUG 499: Alt text should have &#1234;, not &amp;1234;
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="&amp; &lt; &gt; &quot;"><img alt="&amp; &lt; &gt; &quot;" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 BUG 499: Alt text should have &#1234;, not &amp;1234;
-!! input
+!! wikitext
 [[Image:foobar.jpg|&#9792;]]
 [[Image:foobar.jpg|&#9792;]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="♀"><img alt="♀" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 Broken image caption with link
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="♀"><img alt="♀" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 
 !! test
 Broken image caption with link
-!! input
+!! wikitext
 [[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link.
 [[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link.
-!! result
+!! html
 <p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a href="/wiki/Main_Page" title="Main Page">this</a> is just an ordinary link.
 </p>
 !! end
 
 !! test
 Image caption containing another image
 <p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a href="/wiki/Main_Page" title="Main Page">this</a> is just an ordinary link.
 </p>
 !! end
 
 !! test
 Image caption containing another image
-!! input
+!! wikitext
 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
-!! result
+!! html
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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 caption with another <a href="/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="File:Icon.png">image</a> inside it!</div></div></div>
 
 !! end
 
 !! test
 Image caption containing a newline
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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 caption with another <a href="/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="File:Icon.png">image</a> inside it!</div></div></div>
 
 !! end
 
 !! test
 Image caption containing a newline
-!! input
+!! wikitext
 [[Image:Foobar.jpg|This
 *is some text]]
 [[Image:Foobar.jpg|This
 *is some text]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="This *is some text"><img alt="This *is some text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !!end
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="This *is some text"><img alt="This *is some text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !!end
@@ -10353,60 +10476,119 @@ Image caption containing a newline
 !!test
 Parsoid: Image caption containing leading space
 (The leading space should not trigger nowiki escaping in wt2wt mode)
 !!test
 Parsoid: Image caption containing leading space
 (The leading space should not trigger nowiki escaping in wt2wt mode)
-!! input
+!! wikitext
 [[Image:Foobar.jpg|thumb| bar]]
 [[Image:Foobar.jpg|thumb| bar]]
-!! result
+!! html
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>bar</div></div></div>
 
 !!end
 
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>bar</div></div></div>
 
 !!end
 
+!! test
+Images: caption containing a table
+!! wikitext
+[[Image:Foobar.jpg|thumb|200px|This is an example image thumbnail caption with a table
+{|
+! Foo !! Bar
+|-
+| Foo1 || Bar1
+|}
+and some more text.]]
+!! html/php
+<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></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 an example image thumbnail caption with a table <table> <tr> <th> Foo </th> <th> Bar </th></tr> <tr> <td> Foo1 </td> <td> Bar1 </td></tr></table> and some more text.</div></div></div>
+
+!! html/parsoid
+<figure typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="23" width="200"/></a><figcaption>This is an example image thumbnail caption with a table
+<table>
+<tbody>
+<tr><th>Foo </th><th>Bar</th></tr>
+<tr>
+<td>Foo1 </td>
+<td>Bar1</td></tr></tbody></table>and some more text.</figcaption></figure>
+!! end
+
 !! test
 Bug 3090: External links other than http: in image captions
 !! test
 Bug 3090: External links other than http: in image captions
-!! input
-[[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
-!! result
+!! wikitext
+[[File:Foobar.jpg|thumb|200x200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
+!! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></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 caption has <a rel="nofollow" class="external text" href="irc://example.net">irc</a> and <a rel="nofollow" class="external text" href="https://example.com">Secure</a> ext links in it.</div></div></div>
 
 <div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></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 caption has <a rel="nofollow" class="external text" href="irc://example.net">irc</a> and <a rel="nofollow" class="external text" href="https://example.com">Secure</a> ext links in it.</div></div></div>
 
+!! html/parsoid
+<figure typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="23" width="200"/></a><figcaption>This caption has <a rel="mw:ExtLink" href="irc://example.net">irc</a> and <a rel="mw:ExtLink" href="https://example.com">Secure</a> ext links in it.</figcaption></figure>
 !! end
 
 !! test
 Custom class
 !! end
 
 !! test
 Custom class
-!! input
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
 [[Image:foobar.jpg|a|class=b]]
 [[Image:foobar.jpg|a|class=b]]
-!! result
+!! html/php
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="a"><img alt="a" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="b" /></a>
 </p>
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="a"><img alt="a" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="b" /></a>
 </p>
+!! html/parsoid
+<p><span class="mw-default-size b" typeof="mw:Image" data-mw='{"caption":"a"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p>
 !! end
 
 !! test
 Localized image handling (1).
 !! options
 !! end
 
 !! test
 Localized image handling (1).
 !! options
+parsoid=wt2html,wt2wt,html2html
 language=es
 language=es
-!! input
+!! wikitext
 [[Archivo:Foobar.jpg|izquierda|enlace=foo|caption]]
 [[Archivo:Foobar.jpg|izquierda|enlace=foo|caption]]
-!! result
+!! html/php
 <div class="floatleft"><a href="/wiki/Foo" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
 
 <div class="floatleft"><a href="/wiki/Foo" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
 
+!! html/parsoid
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image"><a href="./Foo"><img resource="./Archivo:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a><figcaption>caption</figcaption></figure>
 !! end
 
 !! test
 Localized image handling (2).
 !! options
 !! end
 
 !! test
 Localized image handling (2).
 !! options
+parsoid=wt2html,wt2wt,html2html
 language=es
 language=es
-!! input
+!! wikitext
 [[Archivo:Foobar.jpg|miniatura|izquierda|enlace=foo|caption]]
 [[Archivo:Foobar.jpg|miniatura|izquierda|enlace=foo|caption]]
-!! result
+!! html/php
 <div class="thumb tleft"><div class="thumbinner" style="width:182px;"><a href="/wiki/Foo" title="Foo"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/Archivo:Foobar.jpg" class="internal" title="Aumentar"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>caption</div></div></div>
 
 <div class="thumb tleft"><div class="thumbinner" style="width:182px;"><a href="/wiki/Foo" title="Foo"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/Archivo:Foobar.jpg" class="internal" title="Aumentar"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>caption</div></div></div>
 
+!! html/parsoid
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb"><a href="./Foo"><img resource="./Archivo:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>caption</figcaption></figure>
 !! end
 
 !! test
 "border", "frameless" and "class" attributes on an image.
 !! end
 
 !! test
 "border", "frameless" and "class" attributes on an image.
-!! input
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
 [[File:Foobar.jpg|frameless|border|class=extra|caption]]
 [[File:Foobar.jpg|frameless|border|class=extra|caption]]
-!! result
+!! html/php
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="extra thumbborder" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>
 </p>
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="extra thumbborder" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>
 </p>
+!! html/parsoid
+<p><span class="mw-default-size mw-image-border extra" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a></span></p>
+!! end
+
+# Note that 'right' is the default alignment, despite the misspelled 'righ' below
+!! test
+Invalid image attributes (bug 62500)
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[File:Foobar.jpg|thumb|float|left|caption]]
+
+[[File:Foobar.jpg|thumb|righ|caption]]
+
+[[File:Foobar.jpg|bogus1|thumb|bogus2|left|bogus3|caption]]
+!! html/php
+<div class="thumb tleft"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>caption</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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>caption</div></div></div>
+<div class="thumb tleft"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>caption</div></div></div>
+
+!! html/parsoid
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>caption</figcaption></figure><figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>caption</figcaption></figure><figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>caption</figcaption></figure>
 !! end
 
 !! article
 !! end
 
 !! article
@@ -10417,9 +10599,9 @@ File:Barfoo.jpg
 
 !! test
 Redirected image
 
 !! test
 Redirected image
-!! input
+!! wikitext
 [[Image:Barfoo.jpg]]
 [[Image:Barfoo.jpg]]
-!! result
+!! html
 <p><a href="/wiki/File:Barfoo.jpg" title="File:Barfoo.jpg">File:Barfoo.jpg</a>
 </p>
 !! end
 <p><a href="/wiki/File:Barfoo.jpg" title="File:Barfoo.jpg">File:Barfoo.jpg</a>
 </p>
 !! end
@@ -10428,9 +10610,9 @@ Redirected image
 Missing image with uploads disabled
 !! options
 wgEnableUploads=0
 Missing image with uploads disabled
 !! options
 wgEnableUploads=0
-!! input
+!! wikitext
 [[Image:Foobaz.jpg]]
 [[Image:Foobaz.jpg]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobaz.jpg" title="File:Foobaz.jpg">File:Foobaz.jpg</a>
 </p>
 !! end
 <p><a href="/wiki/File:Foobaz.jpg" title="File:Foobaz.jpg">File:Foobaz.jpg</a>
 </p>
 !! end
@@ -10444,13 +10626,10 @@ wgEnableUploads=0
 
 !! test
 Parsoid-specific image handling - simple image with size and middle alignment
 
 !! test
 Parsoid-specific image handling - simple image with size and middle alignment
-!! options
-parsoid
-!! input
-[[Image:Foobar.jpg|50px|middle]]
-!! result
-<p>
-<span class="mw-valign-middle" typeof="mw:Image">
+!! wikitext
+[[File:Foobar.jpg|middle|50px]]
+!! html/parsoid
+<p><span class="mw-valign-middle" typeof="mw:Image">
 <a href="File:Foobar.jpg">
 <img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50">
 </a>
 <a href="File:Foobar.jpg">
 <img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50">
 </a>
@@ -10459,30 +10638,39 @@ parsoid
 !! end
 
 !! test
 !! end
 
 !! test
-Parsoid-specific image handling - simple image with both sizes, a baseline alignment, and a caption
+Parsoid-specific image handling - simple image with size, middle alignment,
+non-standard namespace alias
 !! options
 !! options
-parsoid
-!! input
-[[Image:Foobar.jpg|500x10px|baseline|caption]]
-!! result
-<p>
-<span class="mw-valign-baseline" typeof="mw:Image" data-mw="{&quot;caption&quot;:&quot;caption&quot;}">
+parsoid=wt2wt,wt2html,html2html
+!! wikitext
+[[Image:Foobar.jpg|middle|50px]]
+!! html/parsoid
+<p><span class="mw-valign-middle" typeof="mw:Image">
 <a href="File:Foobar.jpg">
 <a href="File:Foobar.jpg">
-<img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/89px-Foobar.jpg" height="10" width="89">
+<img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50">
 </a>
 </span>
 </p>
 !! end
 
 !! test
 </a>
 </span>
 </p>
 !! end
 
 !! test
-Parsoid-specific image handling - simple image with border and size spec
+Parsoid-specific image handling - simple image with size and middle alignment
+(existing content)
+!! wikitext
+[[File:Foobar.jpg|50px|middle]]
+!! html/parsoid
+<p><span class="mw-valign-middle" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"width","ak":"50px"},{"ck":"middle","ak":"middle"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p>
+!! end
+
+!! test
+Parsoid-specific image handling - simple image with size and middle alignment
+and non-standard namespace name
 !! options
 !! options
-parsoid
-!! input
-[[Image:Foobar.jpg|50px|border|caption]]
-!! result
-<p>
-<span class="mw-image-border" typeof="mw:Image" data-mw="{&quot;caption&quot;:&quot;caption&quot;}">
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+[[Image:Foobar.jpg|50px|middle]]
+!! html/parsoid
+<p><span class="mw-valign-middle" typeof="mw:Image">
 <a href="File:Foobar.jpg">
 <img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50">
 </a>
 <a href="File:Foobar.jpg">
 <img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50">
 </a>
@@ -10490,28 +10678,49 @@ parsoid
 </p>
 !! end
 
 </p>
 !! end
 
+!! test
+Parsoid-specific image handling - simple image with both sizes, a baseline alignment, and a caption
+!! wikitext
+[[File:Foobar.jpg|500x10px|baseline|caption]]
+!! html/parsoid
+<p><span class="mw-valign-baseline" typeof="mw:Image" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"width","ak":"500x10px"},{"ck":"baseline","ak":"baseline"},{"ck":"caption","ak":"caption"}],"size":"500x10"}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/89px-Foobar.jpg" height="10" width="89" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"10","width":"89"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p>
+!! end
+
+!! test
+Parsoid-specific image handling - simple image with border and size spec
+!! wikitext
+[[File:Foobar.jpg|50px|border|caption]]
+!! html/parsoid
+<p><span class="mw-image-border" typeof="mw:Image" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"width","ak":"50px"},{"ck":"border","ak":"border"},{"ck":"caption","ak":"caption"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p>
+!! end
+
 !! test
 Parsoid-specific image handling - thumbnail with halign, valign, and caption
 !! test
 Parsoid-specific image handling - thumbnail with halign, valign, and caption
-!! options
-parsoid
-!! input
-[[Image:Foobar.jpg|thumb|left|baseline|caption content]]
-!! result
+!! wikitext
+[[File:Foobar.jpg|left|baseline|thumb|caption content]]
+!! html/parsoid
 <figure class="mw-default-size mw-halign-left mw-valign-baseline" typeof="mw:Image/Thumb">
 <a href="File:Foobar.jpg">
 <figure class="mw-default-size mw-halign-left mw-valign-baseline" typeof="mw:Image/Thumb">
 <a href="File:Foobar.jpg">
-<img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" height="21" width="180" />
+<img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" height="25" width="220" />
 </a>
 <figcaption>caption content</figcaption>
 </figure>
 !! end
 
 </a>
 <figcaption>caption content</figcaption>
 </figure>
 !! end
 
+!! test
+Parsoid-specific image handling - thumbnail with halign, valign, and caption
+(existing content)
+!! wikitext
+[[File:Foobar.jpg|thumb|left|baseline|caption content]]
+!! html/parsoid
+<figure class="mw-default-size mw-halign-left mw-valign-baseline" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"left","ak":"left"},{"ck":"baseline","ak":"baseline"},{"ck":"caption","ak":"caption content"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" height="25" width="220" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>caption content</figcaption></figure>
+!! end
+
 !! test
 Parsoid-specific image handling - thumbnail with specific size, halign, valign, and caption
 !! test
 Parsoid-specific image handling - thumbnail with specific size, halign, valign, and caption
-!! options
-parsoid
-!! input
-[[Image:Foobar.jpg|thumb|50x50px|right|middle|caption]]
-!! result
+!! wikitext
+[[Image:Foobar.jpg|right|middle|thumb|50x50px|caption]]
+!! html/parsoid
 <figure class="mw-halign-right mw-valign-middle" typeof="mw:Image/Thumb">
 <a href="File:Foobar.jpg">
 <img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50" />
 <figure class="mw-halign-right mw-valign-middle" typeof="mw:Image/Thumb">
 <a href="File:Foobar.jpg">
 <img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50" />
@@ -10520,13 +10729,20 @@ parsoid
 </figure>
 !! end
 
 </figure>
 !! end
 
+!! test
+Parsoid-specific image handling - thumbnail with specific size, halign,
+valign, and caption (existing content)
+!! wikitext
+[[File:Foobar.jpg|thumb|50x50px|right|middle|caption]]
+!! html/parsoid
+<figure class="mw-halign-right mw-valign-middle" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"50x50px"},{"ck":"right","ak":"right"},{"ck":"middle","ak":"middle"},{"ck":"caption","ak":"caption"}],"size":"50x50"}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>caption</figcaption></figure>
+!! end
+
 !! test
 Parsoid-specific image handling - framed image with specific size and caption
 !! test
 Parsoid-specific image handling - framed image with specific size and caption
-!! options
-parsoid
-!! input
-[[Image:Foobar.jpg|500x50px|frame|caption]]
-!! result
+!! wikitext
+[[Image:Foobar.jpg|frame|500x50px|caption]]
+!! html/parsoid
 <figure typeof="mw:Image/Frame">
 <a href="File:Foobar.jpg">
 <img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" />
 <figure typeof="mw:Image/Frame">
 <a href="File:Foobar.jpg">
 <img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" />
@@ -10535,13 +10751,20 @@ parsoid
 </figure>
 !! end
 
 </figure>
 !! end
 
+!! test
+Parsoid-specific image handling - framed image with specific size and caption
+(existing content)
+!! wikitext
+[[File:Foobar.jpg|442x50px|frame|caption]]
+!! html/parsoid
+<figure typeof="mw:Image/Frame" data-parsoid='{"optList":[{"ck":"width","ak":"442x50px"},{"ck":"framed","ak":"frame"},{"ck":"caption","ak":"caption"}],"size":"442x50"}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"50","width":"442"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>caption</figcaption></figure>
+!! end
+
 !! test
 Parsoid-specific image handling - framed image with specific size, halign, valign, and caption
 !! test
 Parsoid-specific image handling - framed image with specific size, halign, valign, and caption
-!! options
-parsoid
-!! input
-[[Image:Foobar.jpg|500x50px|frame|left|baseline|caption]]
-!! result
+!! wikitext
+[[Image:Foobar.jpg|left|baseline|frame|500x50px|caption]]
+!! html/parsoid
 <figure class="mw-halign-left mw-valign-baseline" typeof="mw:Image/Frame">
 <a href="File:Foobar.jpg">
 <img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" />
 <figure class="mw-halign-left mw-valign-baseline" typeof="mw:Image/Frame">
 <a href="File:Foobar.jpg">
 <img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" />
@@ -10550,44 +10773,39 @@ parsoid
 </figure>
 !! end
 
 </figure>
 !! end
 
+!! test
+Parsoid-specific image handling - framed image with specific size, halign,
+valign, and caption (existing content)
+!! wikitext
+[[File:Foobar.jpg|442x50px|frame|left|baseline|caption]]
+!! html/parsoid
+<figure class="mw-halign-left mw-valign-baseline" typeof="mw:Image/Frame" data-parsoid='{"optList":[{"ck":"width","ak":"442x50px"},{"ck":"framed","ak":"frame"},{"ck":"left","ak":"left"},{"ck":"baseline","ak":"baseline"},{"ck":"caption","ak":"caption"}],"size":"442x50"}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"50","width":"442"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>caption</figcaption></figure>
+!! end
+
 !! test
 Parsoid-specific image handling - frameless image with specific size, border, and caption
 !! test
 Parsoid-specific image handling - frameless image with specific size, border, and caption
-!! options
-parsoid
-!! input
-[[Image:Foobar.jpg|frameless|500x50px|border|caption]]
-!! result
-<p>
-<span class="mw-image-border" typeof="mw:Image/Frameless" data-mw="{&quot;caption&quot;:&quot;caption&quot;}">
-<a href="File:Foobar.jpg">
-<img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" />
-</a>
-</p>
+!! wikitext
+[[File:Foobar.jpg|frameless|442x50px|border|caption]]
+!! html/parsoid
+<p><span class="mw-image-border" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"frameless","ak":"frameless"},{"ck":"width","ak":"442x50px"},{"ck":"border","ak":"border"},{"ck":"caption","ak":"caption"}],"size":"442x50"}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"50","width":"442"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p>
 !! end
 
 !! end
 
-#!! test
-#Parsoid-specific image handling - simple image with a formatted caption
-#!! options
-#parsoid
-#!! input
-#[[Image:Foobar.jpg|<table><tr><td>a</td><td>b</td></tr><tr><td>c</td></tr></table>]]
-#!! result
-#<p>
-#<span typeof="mw:Image">
-#<a class="mw-default-size" href="Image:Foobar.jpg">
-#<img alt="Foobar.jpg" class="mw-default-size" src="http://example.com/images/3/3a/Foobar.jpg" height="220" width="1941">
-#</a>
-#<span>abc</span>
-#</span>
-#</p>
+!! test
+Parsoid-specific image handling - simple image with a formatted caption
+!! wikitext
+[[File:Foobar.jpg|<table><tr><td>a</td><td>b</td></tr><tr><td>c</td></tr></table>]]
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"&lt;table>&lt;tr>&lt;td>a&lt;/td>&lt;td>b&lt;/td>&lt;/tr>&lt;tr>&lt;td>c&lt;/td>&lt;/tr>&lt;/table>"}'>
+<a href="File:Foobar.jpg">
+<img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941">
+</a></span></p>
+!! end
 
 !! test
 Parsoid-specific image handling - caption with a template in it
 
 !! test
 Parsoid-specific image handling - caption with a template in it
-!! options
-parsoid
-!! input
-[[File:Foobar.jpg|thumb|200x200px|This caption has a {{echo|transclusion}} in it.]]
-!! result
+!! wikitext
+[[File:Foobar.jpg|thumb|200x23px|This caption has a {{echo|transclusion}} in it.]]
+!! html/parsoid
 <figure typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" height="23" width="200"></a><figcaption>This caption has a <span about="#mwt1" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;transclusion&quot;}},&quot;i&quot;:0}}]}">transclusion</span> in it.</figcaption></figure>
 !! end
 
 <figure typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" height="23" width="200"></a><figcaption>This caption has a <span about="#mwt1" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;transclusion&quot;}},&quot;i&quot;:0}}]}">transclusion</span> in it.</figcaption></figure>
 !! end
 
@@ -10595,16 +10813,44 @@ parsoid
 Parsoid-specific image handling - caption with unbalanced tags in it
 !! options
 parsoid=wt2html,wt2wt,html2html
 Parsoid-specific image handling - caption with unbalanced tags in it
 !! options
 parsoid=wt2html,wt2wt,html2html
-!! input
+!! wikitext
 foo
 [[File:Foobar.jpg|thumb|200x200px|This caption has a <center>unbalanced tag in it.]]
 bar
 foo
 [[File:Foobar.jpg|thumb|200x200px|This caption has a <center>unbalanced tag in it.]]
 bar
-!! result
+!! html/parsoid
 <p>foo</p>
 <figure typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="23" width="200"></a><figcaption>This caption has a <center>unbalanced tag in it.</center></figcaption></figure>
 <p>bar</p>
 !! end
 
 <p>foo</p>
 <figure typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="23" width="200"></a><figcaption>This caption has a <center>unbalanced tag in it.</center></figcaption></figure>
 <p>bar</p>
 !! end
 
+!! test
+Parsoid-specific image handling - empty caption
+!! wikitext
+[[File:Foobar.jpg|thumb|]]
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption></figcaption></figure>
+!! end
+
+!! test
+Parsoid-specific image handling - whitespace caption
+!! wikitext
+[[File:Foobar.jpg|thumb| ]]
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption> </figcaption></figure>
+!! end
+
+!! test
+Parsoid-specific image handling - lang option
+!! wikitext
+foo
+[[File:Foobar.svg|lang=de|caption]]
+bar
+!! html/parsoid
+<p>foo
+<span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/f/ff/Foobar.svg" lang="de" height="180" width="240"/></a></span>
+bar</p>
+!! end
+
 
 ###
 ### Subpages
 
 ###
 ### Subpages
@@ -10619,9 +10865,9 @@ foo
 Subpage link
 !! options
 subpage title=[[Subpage test]]
 Subpage link
 !! options
 subpage title=[[Subpage test]]
-!! input
+!! wikitext
 [[/subpage]]
 [[/subpage]]
-!! result
+!! html
 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a>
 </p>
 !! end
 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a>
 </p>
 !! end
@@ -10630,9 +10876,9 @@ subpage title=[[Subpage test]]
 Subpage noslash link
 !! options
 subpage title=[[Subpage test]]
 Subpage noslash link
 !! options
 subpage title=[[Subpage test]]
-!!input
+!! wikitext
 [[/subpage/]]
 [[/subpage/]]
-!! result
+!! html
 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">subpage</a>
 </p>
 !! end
 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">subpage</a>
 </p>
 !! end
@@ -10643,11 +10889,11 @@ Relative subpage noslash link
 !! options
 parsoid=wt2wt,wt2html,html2html
 subpage title=[[Subpage test/1/2/3/4]]
 !! options
 parsoid=wt2wt,wt2html,html2html
 subpage title=[[Subpage test/1/2/3/4]]
-!!input
+!! wikitext
 [[../../subpage/]]
 
 [[../../subpage]]
 [[../../subpage/]]
 
 [[../../subpage]]
-!! result
+!! html
 <p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage/">subpage</a></p>
 <p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage">Subpage_test/1/2/subpage</a></p>
 !! end
 <p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage/">subpage</a></p>
 <p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage">Subpage_test/1/2/subpage</a></p>
 !! end
@@ -10657,13 +10903,13 @@ subpage title=[[Subpage test/1/2/3/4]]
 Parsoid: dot-slash prefixed wikilinks
 !! options
 parsoid=wt2wt,wt2html,html2html
 Parsoid: dot-slash prefixed wikilinks
 !! options
 parsoid=wt2wt,wt2html,html2html
-!!input
+!! wikitext
 [[./foo]]
 
 [[././bar]]
 
 [[././baz/]]
 [[./foo]]
 
 [[././bar]]
 
 [[././baz/]]
-!! result
+!! html
 <p><a rel="mw:WikiLink" href="./Foo">foo</a></p>
 <p><a rel="mw:WikiLink" href="./Bar">bar</a></p>
 <p><a rel="mw:WikiLink" href="./Baz/">baz/</a></p>
 <p><a rel="mw:WikiLink" href="./Foo">foo</a></p>
 <p><a rel="mw:WikiLink" href="./Bar">bar</a></p>
 <p><a rel="mw:WikiLink" href="./Baz/">baz/</a></p>
@@ -10671,9 +10917,9 @@ parsoid=wt2wt,wt2html,html2html
 
 !! test
 Disabled subpages
 
 !! test
 Disabled subpages
-!! input
+!! wikitext
 [[/subpage]]
 [[/subpage]]
-!! result
+!! html
 <p><a href="/index.php?title=/subpage&amp;action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a>
 </p>
 !! end
 <p><a href="/index.php?title=/subpage&amp;action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a>
 </p>
 !! end
@@ -10682,9 +10928,9 @@ Disabled subpages
 BUG 561: {{/Subpage}}
 !! options
 subpage title=[[Page]]
 BUG 561: {{/Subpage}}
 !! options
 subpage title=[[Page]]
-!! input
+!! wikitext
 {{/Subpage}}
 {{/Subpage}}
-!! result
+!! html
 <p><a href="/index.php?title=Page/Subpage&amp;action=edit&amp;redlink=1" class="new" title="Page/Subpage (page does not exist)">Page/Subpage</a>
 </p>
 !! end
 <p><a href="/index.php?title=Page/Subpage&amp;action=edit&amp;redlink=1" class="new" title="Page/Subpage (page does not exist)">Page/Subpage</a>
 </p>
 !! end
@@ -10700,9 +10946,9 @@ blah
 
 !! test
 Link to category
 
 !! test
 Link to category
-!! input
+!! wikitext
 [[:Category:MediaWiki User's Guide]]
 [[:Category:MediaWiki User's Guide]]
-!! result
+!! html
 <p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
 </p>
 !! end
 <p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
 </p>
 !! end
@@ -10711,17 +10957,17 @@ Link to category
 Simple category
 !! options
 cat
 Simple category
 !! options
 cat
-!! input
+!! wikitext
 [[Category:MediaWiki User's Guide]]
 [[Category:MediaWiki User's Guide]]
-!! result
+!! html
 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
 !! end
 
 !! test
 PAGESINCATEGORY invalid title fatal (r33546 fix)
 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
 !! end
 
 !! test
 PAGESINCATEGORY invalid title fatal (r33546 fix)
-!! input
+!! wikitext
 {{PAGESINCATEGORY:<bogus>}}
 {{PAGESINCATEGORY:<bogus>}}
-!! result
+!! html
 <p>0
 </p>
 !! end
 <p>0
 </p>
 !! end
@@ -10730,9 +10976,9 @@ PAGESINCATEGORY invalid title fatal (r33546 fix)
 Category with different sort key
 !! options
 cat
 Category with different sort key
 !! options
 cat
-!! input
+!! wikitext
 [[Category:MediaWiki User's Guide|Foo]]
 [[Category:MediaWiki User's Guide|Foo]]
-!! result
+!! html
 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
 !! end
 
 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
 !! end
 
@@ -10740,9 +10986,9 @@ cat
 Category with identical sort key
 !! options
 cat
 Category with identical sort key
 !! options
 cat
-!! input
+!! wikitext
 [[Category:MediaWiki User's Guide|MediaWiki User's Guide]]
 [[Category:MediaWiki User's Guide|MediaWiki User's Guide]]
-!! result
+!! html
 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
 !! end
 
 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
 !! end
 
@@ -10751,9 +10997,9 @@ Category with empty sort key
 !! options
 cat
 pst
 !! options
 cat
 pst
-!! input
+!! wikitext
 [[Category:MediaWiki User's Guide|]]
 [[Category:MediaWiki User's Guide|]]
-!! result
+!! html
 [[Category:MediaWiki User's Guide|MediaWiki User's Guide]]
 !! end
 
 [[Category:MediaWiki User's Guide|MediaWiki User's Guide]]
 !! end
 
@@ -10762,9 +11008,9 @@ Category with empty sort key and parentheses
 !! options
 cat
 pst
 !! options
 cat
 pst
-!! input
+!! wikitext
 [[Category:Foo (bar)|]]
 [[Category:Foo (bar)|]]
-!! result
+!! html
 [[Category:Foo (bar)|Foo]]
 !! end
 
 [[Category:Foo (bar)|Foo]]
 !! end
 
@@ -10773,9 +11019,9 @@ Category with link tail
 !! options
 cat
 pst
 !! options
 cat
 pst
-!! input
+!! wikitext
 123[[Category:Foo]]456
 123[[Category:Foo]]456
-!! result
+!! html
 123[[Category:Foo]]456
 !! end
 
 123[[Category:Foo]]456
 !! end
 
@@ -10784,9 +11030,9 @@ Category with template
 !! options
 cat
 pst
 !! options
 cat
 pst
-!! input
+!! wikitext
 [[Category:{{echo|Foo}}]]
 [[Category:{{echo|Foo}}]]
-!! result
+!! html
 [[Category:{{echo|Foo}}]]
 !! end
 
 [[Category:{{echo|Foo}}]]
 !! end
 
@@ -10795,9 +11041,9 @@ Category with template in sort key
 !! options
 cat
 pst
 !! options
 cat
 pst
-!! input
+!! wikitext
 [[Category:Foo|{{echo|Bar}}]]
 [[Category:Foo|{{echo|Bar}}]]
-!! result
+!! html
 [[Category:Foo|{{echo|Bar}}]]
 !! end
 
 [[Category:Foo|{{echo|Bar}}]]
 !! end
 
@@ -10806,15 +11052,15 @@ Category with template in sort key and title
 !! options
 cat
 pst
 !! options
 cat
 pst
-!! input
+!! wikitext
 [[Category:{{echo|Foo}}|{{echo|Bar}}]]
 [[Category:{{echo|Foo}}|{{echo|Bar}}]]
-!! result
+!! html
 [[Category:{{echo|Foo}}|{{echo|Bar}}]]
 !! end
 
 !! test
 Category / paragraph interactions
 [[Category:{{echo|Foo}}|{{echo|Bar}}]]
 !! end
 
 !! test
 Category / paragraph interactions
-!! input
+!! wikitext
 Foo [[Category:Baz]] Bar
 
 Foo [[Category:Baz]]
 Foo [[Category:Baz]] Bar
 
 Foo [[Category:Baz]]
@@ -10840,7 +11086,7 @@ Bar
 [[Category:Baz]]
  {{echo|[[Category:Baz]]}}
 [[Category:Baz]]
 [[Category:Baz]]
  {{echo|[[Category:Baz]]}}
 [[Category:Baz]]
-!! result
+!! html
 <p>Foo Bar
 </p><p>Foo
 Bar
 <p>Foo Bar
 </p><p>Foo
 Bar
@@ -10856,11 +11102,11 @@ Bar
 Parsoid: Serialize link to category page with colon escape
 !! options
 parsoid
 Parsoid: Serialize link to category page with colon escape
 !! options
 parsoid
-!! input
+!! wikitext
 
 [[:Category:Foo]]
 [[:Category:Foo|Bar]]
 
 [[:Category:Foo]]
 [[:Category:Foo|Bar]]
-!! result
+!! html
 <p>
 <a rel="mw:WikiLink" href="Category:Foo">Category:Foo</a>
 <a rel="mw:WikiLink" href="Category:Foo">Bar</a>
 <p>
 <a rel="mw:WikiLink" href="Category:Foo">Category:Foo</a>
 <a rel="mw:WikiLink" href="Category:Foo">Bar</a>
@@ -10872,9 +11118,9 @@ Parsoid: Link prefix/suffixes aren't applied to category links
 !! options
 parsoid=wt2html,wt2wt,html2html
 language=is
 !! options
 parsoid=wt2html,wt2wt,html2html
 language=is
-!! input
+!! wikitext
 x[[Category:Foo]]y
 x[[Category:Foo]]y
-!! result
+!! html
 <p>x<link rel="mw:PageProp/Category" href="Category:Foo">y</p>
 !! end
 
 <p>x<link rel="mw:PageProp/Category" href="Category:Foo">y</p>
 !! end
 
@@ -10882,11 +11128,11 @@ x[[Category:Foo]]y
 Parsoid: Serialize link to file page with colon escape
 !! options
 parsoid
 Parsoid: Serialize link to file page with colon escape
 !! options
 parsoid
-!! input
+!! wikitext
 
 [[:File:Foo.png]]
 [[:File:Foo.png|Bar]]
 
 [[:File:Foo.png]]
 [[:File:Foo.png|Bar]]
-!! result
+!! html
 <p>
 <a rel="mw:WikiLink" href="File:Foo.png">File:Foo.png</a>
 <a rel="mw:WikiLink" href="File:Foo.png">Bar</a>
 <p>
 <a rel="mw:WikiLink" href="File:Foo.png">File:Foo.png</a>
 <a rel="mw:WikiLink" href="File:Foo.png">Bar</a>
@@ -10897,10 +11143,10 @@ parsoid
 Parsoid: Serialize a genuine category link without colon escape
 !! options
 parsoid
 Parsoid: Serialize a genuine category link without colon escape
 !! options
 parsoid
-!! input
+!! wikitext
 [[Category:Foo]]
 [[Category:Foo|Bar]]
 [[Category:Foo]]
 [[Category:Foo|Bar]]
-!! result
+!! html
 <link rel="mw:PageProp/Category" href="Category:Foo">
 <link rel="mw:PageProp/Category" href="Category:Foo#Bar">
 !! end
 <link rel="mw:PageProp/Category" href="Category:Foo">
 <link rel="mw:PageProp/Category" href="Category:Foo#Bar">
 !! end
@@ -10909,9 +11155,9 @@ parsoid
 Parsoid: Defaultsort
 !! options
 parsoid
 Parsoid: Defaultsort
 !! options
 parsoid
-!! input
+!! wikitext
 {{DEFAULTSORT:Foo}}
 {{DEFAULTSORT:Foo}}
-!! result
+!! html
 <meta property="mw:PageProp/categorydefaultsort" content="Foo"/>
 !! end
 
 <meta property="mw:PageProp/categorydefaultsort" content="Foo"/>
 !! end
 
@@ -10922,11 +11168,11 @@ parsoid
 Inter-language links
 !! options
 ill
 Inter-language links
 !! options
 ill
-!! input
+!! wikitext
 [[es:Alimento]]
 [[fr:Nourriture]]
 [[zh:&#39135;&#21697;]]
 [[es:Alimento]]
 [[fr:Nourriture]]
 [[zh:&#39135;&#21697;]]
-!! result
+!! html
 es:Alimento fr:Nourriture zh:食品
 !! end
 
 es:Alimento fr:Nourriture zh:食品
 !! end
 
@@ -10934,12 +11180,12 @@ es:Alimento fr:Nourriture zh:食品
 Duplicate interlanguage links (bug 24502)
 !! options
 ill
 Duplicate interlanguage links (bug 24502)
 !! options
 ill
-!! input
+!! wikitext
 [[es:1]]
 [[es:2]]
 [[fr:1]]
 [[fr:2]]
 [[es:1]]
 [[es:2]]
 [[fr:1]]
 [[fr:2]]
-!! result
+!! html
 es:1 fr:1
 !! end
 
 es:1 fr:1
 !! end
 
@@ -10948,7 +11194,7 @@ es:1 fr:1
 ###
 !! test
 Basic section headings
 ###
 !! test
 Basic section headings
-!! input
+!! wikitext
 == Headline 1 ==
 Some text
 
 == Headline 1 ==
 Some text
 
@@ -10956,7 +11202,7 @@ Some text
 More
 ===Smaller headline===
 Blah blah
 More
 ===Smaller headline===
 Blah blah
-!! result
+!! html
 <h2><span class="mw-headline" id="Headline_1">Headline 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <p>Some text
 </p>
 <h2><span class="mw-headline" id="Headline_1">Headline 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <p>Some text
 </p>
@@ -10970,7 +11216,7 @@ Blah blah
 
 !! test
 Section headings with TOC
 
 !! test
 Section headings with TOC
-!! input
+!! wikitext
 == Headline 1 ==
 === Subheadline 1 ===
 ===== Skipping a level =====
 == Headline 1 ==
 === Subheadline 1 ===
 ===== Skipping a level =====
@@ -10979,7 +11225,7 @@ Section headings with TOC
 == Headline 2 ==
 Some text
 ===Another headline===
 == Headline 2 ==
 Some text
 ===Another headline===
-!! result
+!! html
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#Headline_1"><span class="tocnumber">1</span> <span class="toctext">Headline 1</span></a>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#Headline_1"><span class="tocnumber">1</span> <span class="toctext">Headline 1</span></a>
@@ -11017,7 +11263,7 @@ Some text
 # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
 !! test
 Handling of sections up to level 6 and beyond
 # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
 !! test
 Handling of sections up to level 6 and beyond
-!! input
+!! wikitext
 = Level 1 Heading=
 == Level 2 Heading==
 === Level 3 Heading===
 = Level 1 Heading=
 == Level 2 Heading==
 === Level 3 Heading===
@@ -11028,7 +11274,7 @@ Handling of sections up to level 6 and beyond
 ======== Level 8 Heading========
 ========= Level 9 Heading=========
 ========== Level 10 Heading==========
 ======== Level 8 Heading========
 ========= Level 9 Heading=========
 ========== Level 10 Heading==========
-!! result
+!! html
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
@@ -11074,14 +11320,14 @@ Handling of sections up to level 6 and beyond
 
 !! test
 TOC regression (bug 9764)
 
 !! test
 TOC regression (bug 9764)
-!! input
+!! wikitext
 == title 1 ==
 === title 1.1 ===
 ==== title 1.1.1 ====
 === title 1.2 ===
 == title 2 ==
 === title 2.1 ===
 == title 1 ==
 === title 1.1 ===
 ==== title 1.1.1 ====
 === title 1.2 ===
 == title 2 ==
 === title 2.1 ===
-!! result
+!! html
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
@@ -11115,14 +11361,14 @@ TOC regression (bug 9764)
 TOC with wgMaxTocLevel=3 (bug 6204)
 !! options
 wgMaxTocLevel=3
 TOC with wgMaxTocLevel=3 (bug 6204)
 !! options
 wgMaxTocLevel=3
-!! input
+!! wikitext
 == title 1 ==
 === title 1.1 ===
 ==== title 1.1.1 ====
 === title 1.2 ===
 == title 2 ==
 === title 2.1 ===
 == title 1 ==
 === title 1.1 ===
 ==== title 1.1.1 ====
 === title 1.2 ===
 == title 2 ==
 === title 2.1 ===
-!! result
+!! html
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
@@ -11152,13 +11398,13 @@ wgMaxTocLevel=3
 TOC with wgMaxTocLevel=3 and two level four headings (bug 6204)
 !! options
 wgMaxTocLevel=3
 TOC with wgMaxTocLevel=3 and two level four headings (bug 6204)
 !! options
 wgMaxTocLevel=3
-!! input
+!! wikitext
 ==Section 1==
 ===Section 1.1===
 ====Section 1.1.1====
 ====Section 1.1.1.1====
 ==Section 2==
 ==Section 1==
 ===Section 1.1===
 ====Section 1.1.1====
 ====Section 1.1.1.1====
 ==Section 2==
-!! result
+!! html
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#Section_1"><span class="tocnumber">1</span> <span class="toctext">Section 1</span></a>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#Section_1"><span class="tocnumber">1</span> <span class="toctext">Section 1</span></a>
@@ -11181,10 +11427,10 @@ wgMaxTocLevel=3
 
 !! test
 Resolving duplicate section names
 
 !! test
 Resolving duplicate section names
-!! input
+!! wikitext
 == Foo bar ==
 == Foo bar ==
 == Foo bar ==
 == Foo bar ==
-!! result
+!! html
 <h2><span class="mw-headline" id="Foo_bar">Foo bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Foo_bar_2">Foo bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 <h2><span class="mw-headline" id="Foo_bar">Foo bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Foo_bar_2">Foo bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
@@ -11192,10 +11438,10 @@ Resolving duplicate section names
 
 !! test
 Resolving duplicate section names with differing case (bug 10721)
 
 !! test
 Resolving duplicate section names with differing case (bug 10721)
-!! input
+!! wikitext
 == Foo bar ==
 == Foo Bar ==
 == Foo bar ==
 == Foo Bar ==
-!! result
+!! html
 <h2><span class="mw-headline" id="Foo_bar">Foo bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Foo_Bar_2">Foo Bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 <h2><span class="mw-headline" id="Foo_bar">Foo bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Foo_Bar_2">Foo Bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
@@ -11210,12 +11456,12 @@ Template:sections
 
 !! test
 Template with sections, __NOTOC__
 
 !! test
 Template with sections, __NOTOC__
-!! input
+!! wikitext
 __NOTOC__
 ==Section 0==
 {{sections}}
 ==Section 4==
 __NOTOC__
 ==Section 0==
 {{sections}}
 ==Section 4==
-!! result
+!! html
 <h2><span class="mw-headline" id="Section_0">Section 0</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 0">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h3><span class="mw-headline" id="Section_1">Section 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=T-1" title="Template:Sections">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
 <h2><span class="mw-headline" id="Section_2">Section 2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=T-2" title="Template:Sections">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Section_0">Section 0</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 0">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h3><span class="mw-headline" id="Section_1">Section 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=T-1" title="Template:Sections">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
 <h2><span class="mw-headline" id="Section_2">Section 2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=T-2" title="Template:Sections">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
@@ -11225,11 +11471,11 @@ __NOTOC__
 
 !! test
 __NOEDITSECTION__ keyword
 
 !! test
 __NOEDITSECTION__ keyword
-!! input
+!! wikitext
 __NOEDITSECTION__
 ==Section 1==
 ==Section 2==
 __NOEDITSECTION__
 ==Section 1==
 ==Section 2==
-!! result
+!! html
 <h2><span class="mw-headline" id="Section_1">Section 1</span></h2>
 <h2><span class="mw-headline" id="Section_2">Section 2</span></h2>
 
 <h2><span class="mw-headline" id="Section_1">Section 1</span></h2>
 <h2><span class="mw-headline" id="Section_2">Section 2</span></h2>
 
@@ -11237,21 +11483,21 @@ __NOEDITSECTION__
 
 !! test
 Link inside a section heading
 
 !! test
 Link inside a section heading
-!! input
+!! wikitext
 ==Section with a [[Main Page|link]] in it==
 ==Section with a [[Main Page|link]] in it==
-!! result
+!! html
 <h2><span class="mw-headline" id="Section_with_a_link_in_it">Section with a <a href="/wiki/Main_Page" title="Main Page">link</a> in it</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section with a link in it">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
 
 !! test
 TOC regression (bug 12077)
 <h2><span class="mw-headline" id="Section_with_a_link_in_it">Section with a <a href="/wiki/Main_Page" title="Main Page">link</a> in it</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section with a link in it">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
 
 !! test
 TOC regression (bug 12077)
-!! input
+!! wikitext
 __TOC__
 == title 1 ==
 === title 1.1 ===
 == title 2 ==
 __TOC__
 == title 1 ==
 === title 1.1 ===
 == title 2 ==
-!! result
+!! html
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
@@ -11271,22 +11517,22 @@ __TOC__
 
 !! test
 BUG 1219 URL next to image (good)
 
 !! test
 BUG 1219 URL next to image (good)
-!! input
+!! wikitext
 http://example.com [[Image:foobar.jpg]]
 http://example.com [[Image:foobar.jpg]]
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> <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>
 </p>
 !!end
 
 !! test
 Short headings with trailing space should match behavior of Parser::doHeadings (bug 19910)
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> <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>
 </p>
 !!end
 
 !! test
 Short headings with trailing space should match behavior of Parser::doHeadings (bug 19910)
-!! input
+!! wikitext
 === 
 The line above must have a trailing space!
 === <!--
 --> <!-- -->
 But just in case it doesn't...
 === 
 The line above must have a trailing space!
 === <!--
 --> <!-- -->
 But just in case it doesn't...
-!! result
+!! html
 <h1><span class="mw-headline" id=".3D">=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: =">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
 <p>The line above must have a trailing space!
 </p>
 <h1><span class="mw-headline" id=".3D">=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: =">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
 <p>The line above must have a trailing space!
 </p>
@@ -11297,7 +11543,7 @@ But just in case it doesn't...
 
 !! test
 Header with special characters (bug 25462)
 
 !! test
 Header with special characters (bug 25462)
-!! input
+!! wikitext
 The tooltips shall not show entities to the user (ie. be double escaped)
 
 == text > text ==
 The tooltips shall not show entities to the user (ie. be double escaped)
 
 == text > text ==
@@ -11314,7 +11560,7 @@ section 4
 
 == text " text ==
 section 5
 
 == text " text ==
 section 5
-!! result
+!! html
 <p>The tooltips shall not show entities to the user (ie. be double escaped)
 </p>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <p>The tooltips shall not show entities to the user (ie. be double escaped)
 </p>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
@@ -11347,12 +11593,12 @@ section 5
 !! test
 Headers with excess '=' characters
 (Are similar tests necessary beyond the 1st level?)
 !! test
 Headers with excess '=' characters
 (Are similar tests necessary beyond the 1st level?)
-!! input
+!! wikitext
 =foo==
 ==foo=
 =''italic'' heading==
 ==''italic'' heading=
 =foo==
 ==foo=
 =''italic'' heading==
 ==''italic'' heading=
-!! result
+!! html
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#foo.3D"><span class="tocnumber">1</span> <span class="toctext">foo=</span></a></li>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#foo.3D"><span class="tocnumber">1</span> <span class="toctext">foo=</span></a></li>
@@ -11372,7 +11618,7 @@ Headers with excess '=' characters
 !! test
 HTML headers vs TOC (bug 23393)
 (__NOEDITSECTION__ for clearer output, doesn't matter here)
 !! test
 HTML headers vs TOC (bug 23393)
 (__NOEDITSECTION__ for clearer output, doesn't matter here)
-!! input
+!! wikitext
 <h1>Header 1</h1>
 == Header 1.1 ==
 == Header 1.2 ==
 <h1>Header 1</h1>
 == Header 1.1 ==
 == Header 1.2 ==
@@ -11382,7 +11628,7 @@ HTML headers vs TOC (bug 23393)
 == Header 2.1 ==
 == Header 2.2 ==
 __NOEDITSECTION__
 == Header 2.1 ==
 == Header 2.2 ==
 __NOEDITSECTION__
-!! result
+!! html
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1"><a href="#Header_1"><span class="tocnumber">1</span> <span class="toctext">Header 1</span></a>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1"><a href="#Header_1"><span class="tocnumber">1</span> <span class="toctext">Header 1</span></a>
@@ -11411,18 +11657,18 @@ __NOEDITSECTION__
 
 !! test
 BUG 1219 URL next to image (broken)
 
 !! test
 BUG 1219 URL next to image (broken)
-!! input
+!! wikitext
 http://example.com[[Image:foobar.jpg]]
 http://example.com[[Image:foobar.jpg]]
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><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>
 </p>
 !!end
 
 !! test
 Bug 1186 news: in the middle of text
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><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>
 </p>
 !!end
 
 !! test
 Bug 1186 news: in the middle of text
-!! input
+!! wikitext
 http://en.wikinews.org/wiki/Wikinews:Workplace
 http://en.wikinews.org/wiki/Wikinews:Workplace
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://en.wikinews.org/wiki/Wikinews:Workplace">http://en.wikinews.org/wiki/Wikinews:Workplace</a>
 </p>
 !!end
 <p><a rel="nofollow" class="external free" href="http://en.wikinews.org/wiki/Wikinews:Workplace">http://en.wikinews.org/wiki/Wikinews:Workplace</a>
 </p>
 !!end
@@ -11430,18 +11676,18 @@ http://en.wikinews.org/wiki/Wikinews:Workplace
 
 !! test
 Namespaced link must have a title
 
 !! test
 Namespaced link must have a title
-!! input
+!! wikitext
 [[Project:]]
 [[Project:]]
-!! result
+!! html
 <p>[[Project:]]
 </p>
 !!end
 
 !! test
 Namespaced link must have a title (bad fragment version)
 <p>[[Project:]]
 </p>
 !!end
 
 !! test
 Namespaced link must have a title (bad fragment version)
-!! input
+!! wikitext
 [[Project:#fragment]]
 [[Project:#fragment]]
-!! result
+!! html
 <p>[[Project:#fragment]]
 </p>
 !!end
 <p>[[Project:#fragment]]
 </p>
 !!end
@@ -11453,45 +11699,45 @@ Namespaced link must have a title (bad fragment version)
 
 !! test
 div with no attributes
 
 !! test
 div with no attributes
-!! input
+!! wikitext
 <div>HTML rocks</div>
 <div>HTML rocks</div>
-!! result
+!! html
 <div>HTML rocks</div>
 
 !! end
 
 !! test
 div with double-quoted attribute
 <div>HTML rocks</div>
 
 !! end
 
 !! test
 div with double-quoted attribute
-!! input
+!! wikitext
 <div id="rock">HTML rocks</div>
 <div id="rock">HTML rocks</div>
-!! result
+!! html
 <div id="rock">HTML rocks</div>
 
 !! end
 
 !! test
 div with single-quoted attribute
 <div id="rock">HTML rocks</div>
 
 !! end
 
 !! test
 div with single-quoted attribute
-!! input
+!! wikitext
 <div id='rock'>HTML rocks</div>
 <div id='rock'>HTML rocks</div>
-!! result
+!! html
 <div id="rock">HTML rocks</div>
 
 !! end
 
 !! test
 div with unquoted attribute
 <div id="rock">HTML rocks</div>
 
 !! end
 
 !! test
 div with unquoted attribute
-!! input
+!! wikitext
 <div id=rock>HTML rocks</div>
 <div id=rock>HTML rocks</div>
-!! result
+!! html
 <div id="rock">HTML rocks</div>
 
 !! end
 
 !! test
 div with illegal double attributes
 <div id="rock">HTML rocks</div>
 
 !! end
 
 !! test
 div with illegal double attributes
-!! input
+!! wikitext
 <div id="a" id="b">HTML rocks</div>
 <div id="a" id="b">HTML rocks</div>
-!! result
+!! html
 <div id="b">HTML rocks</div>
 
 !!end
 <div id="b">HTML rocks</div>
 
 !!end
@@ -11502,9 +11748,9 @@ div with illegal double attributes
 div with empty attribute value, space before equals
 !! options
 parsoid
 div with empty attribute value, space before equals
 !! options
 parsoid
-!! input
+!! wikitext
 <div class =>HTML rocks</div>
 <div class =>HTML rocks</div>
-!! result
+!! html
 <div class="">HTML rocks</div>
 
 !! end
 <div class="">HTML rocks</div>
 
 !! end
@@ -11515,9 +11761,9 @@ parsoid
 div with braces in attribute value
 !! options
 parsoid
 div with braces in attribute value
 !! options
 parsoid
-!! input
+!! wikitext
 <div title="{}">Foo</div>
 <div title="{}">Foo</div>
-!! result
+!! html
 <div title="{}">Foo</div>
 !! end
 
 <div title="{}">Foo</div>
 !! end
 
@@ -11532,29 +11778,29 @@ parsoid
 div with empty attribute value, no space before equals
 !! options
 parsoid
 div with empty attribute value, no space before equals
 !! options
 parsoid
-!! input
+!! wikitext
 <div class=>HTML rocks</div>
 <div class=>HTML rocks</div>
-!! result
+!! html
 <div class="">HTML rocks</div>
 
 !! end
 
 !! test
 HTML multiple attributes correction
 <div class="">HTML rocks</div>
 
 !! end
 
 !! test
 HTML multiple attributes correction
-!! input
+!! wikitext
 <p class="error" class="awesome">Awesome!</p>
 <p class="error" class="awesome">Awesome!</p>
-!! result
+!! html
 <p class="awesome">Awesome!</p>
 
 !!end
 
 !! test
 Table multiple attributes correction
 <p class="awesome">Awesome!</p>
 
 !!end
 
 !! test
 Table multiple attributes correction
-!! input
+!! wikitext
 {|
 !+ class="error" class="awesome"| status
 |}
 {|
 !+ class="error" class="awesome"| status
 |}
-!! result
+!! html
 <table>
 <tr>
 <th class="awesome"> status
 <table>
 <tr>
 <th class="awesome"> status
@@ -11564,63 +11810,63 @@ Table multiple attributes correction
 
 !! test
 DIV IN UPPERCASE
 
 !! test
 DIV IN UPPERCASE
-!! input
+!! wikitext
 <DIV ID="x">HTML ROCKS</DIV>
 <DIV ID="x">HTML ROCKS</DIV>
-!! result
+!! html
 <div id="x">HTML ROCKS</div>
 
 !!end
 
 !! test
 Non-ASCII pseudo-tags are rendered as text
 <div id="x">HTML ROCKS</div>
 
 !!end
 
 !! test
 Non-ASCII pseudo-tags are rendered as text
-!! input
+!! wikitext
 <khyô>
 <khyô>
-!! result
+!! html
 <p>&lt;khyô&gt;
 </p>
 !! end
 
 !! test
 Pseudo-tag with URL 'name' renders as url link
 <p>&lt;khyô&gt;
 </p>
 !! end
 
 !! test
 Pseudo-tag with URL 'name' renders as url link
-!! input
+!! wikitext
 <http://example.com/>
 <http://example.com/>
-!! result
+!! html
 <p>&lt;<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>&gt;
 </p>
 !! end
 
 !! test
 text with amp in the middle of nowhere
 <p>&lt;<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>&gt;
 </p>
 !! end
 
 !! test
 text with amp in the middle of nowhere
-!! input
+!! wikitext
 Remember AT&T?
 Remember AT&T?
-!!result
+!! html
 <p>Remember AT&amp;T?
 </p>
 !! end
 
 !! test
 text with character entity: eacute
 <p>Remember AT&amp;T?
 </p>
 !! end
 
 !! test
 text with character entity: eacute
-!! input
+!! wikitext
 I always thought &eacute; was a cute letter.
 I always thought &eacute; was a cute letter.
-!! result
+!! html
 <p>I always thought &#233; was a cute letter.
 </p>
 !! end
 
 !! test
 text with entity-escaped character entity-like string: eacute
 <p>I always thought &#233; was a cute letter.
 </p>
 !! end
 
 !! test
 text with entity-escaped character entity-like string: eacute
-!! input
+!! wikitext
 I always thought &amp;eacute; was a cute letter.
 I always thought &amp;eacute; was a cute letter.
-!! result
+!! html
 <p>I always thought &amp;eacute; was a cute letter.
 </p>
 !! end
 
 !! test
 text with undefined character entity: xacute
 <p>I always thought &amp;eacute; was a cute letter.
 </p>
 !! end
 
 !! test
 text with undefined character entity: xacute
-!! input
+!! wikitext
 I always thought &xacute; was a cute letter.
 I always thought &xacute; was a cute letter.
-!! result
+!! html
 <p>I always thought &amp;xacute; was a cute letter.
 </p>
 !! end
 <p>I always thought &amp;xacute; was a cute letter.
 </p>
 !! end
@@ -11630,11 +11876,11 @@ I always thought &xacute; was a cute letter.
 HTML5 tags
 !! options
 parsoid
 HTML5 tags
 !! options
 parsoid
-!! input
+!! wikitext
 <data value="5">five</data>
 <time datetime="2000-01-01T00:00Z">The new millenium started</time>
 <mark>This highlighted text</mark>
 <data value="5">five</data>
 <time datetime="2000-01-01T00:00Z">The new millenium started</time>
 <mark>This highlighted text</mark>
-!! result
+!! html
 <p><data value="5">five</data>
 <time datetime="2000-01-01T00:00Z">The new millenium started</time>
 <mark>This highlighted text</mark></p>
 <p><data value="5">five</data>
 <time datetime="2000-01-01T00:00Z">The new millenium started</time>
 <mark>This highlighted text</mark></p>
@@ -11642,9 +11888,9 @@ parsoid
 
 !! test
 HTML tag with leading space is parsed as text
 
 !! test
 HTML tag with leading space is parsed as text
-!! input
+!! wikitext
 < div>foo< /div>
 < div>foo< /div>
-!! result
+!! html
 <p>&lt; div&gt;foo&lt; /div&gt;
 </p>
 !! end
 <p>&lt; div&gt;foo&lt; /div&gt;
 </p>
 !! end
@@ -11658,9 +11904,9 @@ HTML tag with leading space is parsed as text
 # the test case, instead of <big>
 !! test
 Ensure that HTML adoption agency algorithm is properly implemented.
 # the test case, instead of <big>
 !! test
 Ensure that HTML adoption agency algorithm is properly implemented.
-!! input
+!! wikitext
 <big>X<big>Y</big>Z</big>
 <big>X<big>Y</big>Z</big>
-!! result
+!! html
 <p><big>X<big>Y</big>Z</big>
 </p>
 !! end
 <p><big>X<big>Y</big>Z</big>
 </p>
 !! end
@@ -11668,9 +11914,9 @@ Ensure that HTML adoption agency algorithm is properly implemented.
 # This was bug 41545 in the PHP parser.
 !! test
 Nesting of <kbd>
 # This was bug 41545 in the PHP parser.
 !! test
 Nesting of <kbd>
-!! input
+!! wikitext
 <kbd>X<kbd>Y</kbd>Z</kbd>
 <kbd>X<kbd>Y</kbd>Z</kbd>
-!! result
+!! html
 <p><kbd>X<kbd>Y</kbd>Z</kbd>
 </p>
 !! end
 <p><kbd>X<kbd>Y</kbd>Z</kbd>
 </p>
 !! end
@@ -11680,45 +11926,45 @@ Nesting of <kbd>
 # not covered; see bug 51081 for discussion.
 !! test
 Nesting of <em>
 # not covered; see bug 51081 for discussion.
 !! test
 Nesting of <em>
-!! input
+!! wikitext
 <em>X<em>Y</em>Z</em>
 <em>X<em>Y</em>Z</em>
-!! result
+!! html
 <p><em>X<em>Y</em>Z</em>
 </p>
 !! end
 
 !! test
 Nesting of <strong>
 <p><em>X<em>Y</em>Z</em>
 </p>
 !! end
 
 !! test
 Nesting of <strong>
-!! input
+!! wikitext
 <strong>X<strong>Y</strong>Z</strong>
 <strong>X<strong>Y</strong>Z</strong>
-!! result
+!! html
 <p><strong>X<strong>Y</strong>Z</strong>
 </p>
 !! end
 
 !! test
 Nesting of <q>
 <p><strong>X<strong>Y</strong>Z</strong>
 </p>
 !! end
 
 !! test
 Nesting of <q>
-!! input
+!! wikitext
 <q>X<q>Y</q>Z</q>
 <q>X<q>Y</q>Z</q>
-!! result
+!! html
 <p><q>X<q>Y</q>Z</q>
 </p>
 !! end
 
 !! test
 Nesting of <ruby>
 <p><q>X<q>Y</q>Z</q>
 </p>
 !! end
 
 !! test
 Nesting of <ruby>
-!! input
+!! wikitext
 <ruby>X<ruby>Y</ruby>Z</ruby>
 <ruby>X<ruby>Y</ruby>Z</ruby>
-!! result
+!! html
 <p><ruby>X<ruby>Y</ruby>Z</ruby>
 </p>
 !! end
 
 !! test
 Nesting of <bdo>
 <p><ruby>X<ruby>Y</ruby>Z</ruby>
 </p>
 !! end
 
 !! test
 Nesting of <bdo>
-!! input
+!! wikitext
 <bdo>X<bdo>Y</bdo>Z</bdo>
 <bdo>X<bdo>Y</bdo>Z</bdo>
-!! result
+!! html
 <p><bdo>X<bdo>Y</bdo>Z</bdo>
 </p>
 !! end
 <p><bdo>X<bdo>Y</bdo>Z</bdo>
 </p>
 !! end
@@ -11730,18 +11976,18 @@ Nesting of <bdo>
 
 !! test
 Media link
 
 !! test
 Media link
-!! input
+!! wikitext
 [[Media:Foobar.jpg]]
 [[Media:Foobar.jpg]]
-!! result
+!! html
 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Media:Foobar.jpg</a>
 </p>
 !! end
 
 !! test
 Media link with text
 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Media:Foobar.jpg</a>
 </p>
 !! end
 
 !! test
 Media link with text
-!! input
+!! wikitext
 [[Media:Foobar.jpg|A neat file to look at]]
 [[Media:Foobar.jpg|A neat file to look at]]
-!! result
+!! html
 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">A neat file to look at</a>
 </p>
 !! end
 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">A neat file to look at</a>
 </p>
 !! end
@@ -11750,36 +11996,36 @@ Media link with text
 !! test
 Media link with nasty text
 fixme: doBlockLevels won't wrap this in a paragraph because it contains a div
 !! test
 Media link with nasty text
 fixme: doBlockLevels won't wrap this in a paragraph because it contains a div
-!! input
+!! wikitext
 [[Media:Foobar.jpg|Safe Link<div style=display:none>" onmouseover="alert(document.cookie)" onfoo="</div>]]
 [[Media:Foobar.jpg|Safe Link<div style=display:none>" onmouseover="alert(document.cookie)" onfoo="</div>]]
-!! result
+!! html
 <a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link&lt;div style="display:none"&gt;" onmouseover="alert(document.cookie)" onfoo="&lt;/div&gt;</a>
 
 !! end
 
 !! test
 Media link to nonexistent file (bug 1702)
 <a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link&lt;div style="display:none"&gt;" onmouseover="alert(document.cookie)" onfoo="&lt;/div&gt;</a>
 
 !! end
 
 !! test
 Media link to nonexistent file (bug 1702)
-!! input
+!! wikitext
 [[Media:No such.jpg]]
 [[Media:No such.jpg]]
-!! result
+!! html
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="No such.jpg">Media:No such.jpg</a>
 </p>
 !! end
 
 !! test
 Image link to nonexistent file (bug 1850 - good)
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="No such.jpg">Media:No such.jpg</a>
 </p>
 !! end
 
 !! test
 Image link to nonexistent file (bug 1850 - good)
-!! input
+!! wikitext
 [[Image:No such.jpg]]
 [[Image:No such.jpg]]
-!! result
+!! html
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="File:No such.jpg">File:No such.jpg</a>
 </p>
 !! end
 
 !! test
 :Image link to nonexistent file (bug 1850 - bad)
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="File:No such.jpg">File:No such.jpg</a>
 </p>
 !! end
 
 !! test
 :Image link to nonexistent file (bug 1850 - bad)
-!! input
+!! wikitext
 [[:Image:No such.jpg]]
 [[:Image:No such.jpg]]
-!! result
+!! html
 <p><a href="/index.php?title=File:No_such.jpg&amp;action=edit&amp;redlink=1" class="new" title="File:No such.jpg (page does not exist)">Image:No such.jpg</a>
 </p>
 !! end
 <p><a href="/index.php?title=File:No_such.jpg&amp;action=edit&amp;redlink=1" class="new" title="File:No such.jpg (page does not exist)">Image:No such.jpg</a>
 </p>
 !! end
@@ -11788,9 +12034,9 @@ Image link to nonexistent file (bug 1850 - good)
 
 !! test
 Character reference normalization in link text (bug 1938)
 
 !! test
 Character reference normalization in link text (bug 1938)
-!! input
+!! wikitext
 [[Main Page|this&that]]
 [[Main Page|this&that]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">this&amp;that</a>
 </p>
 !!end
 <p><a href="/wiki/Main_Page" title="Main Page">this&amp;that</a>
 </p>
 !!end
@@ -11805,13 +12051,13 @@ The page's name is U+05d0 U+05b7, with non-canonical form U+FB2E
 
 !! test
 (bug 19451) Links should refer to the normalized form.
 
 !! test
 (bug 19451) Links should refer to the normalized form.
-!! input
+!! wikitext
 [[&#xFB2E;]]
 [[&#x5d0;&#x5b7;]]
 [[&#x5d0;ַ]]
 [[א&#x5b7;]]
 [[אַ]]
 [[&#xFB2E;]]
 [[&#x5d0;&#x5b7;]]
 [[&#x5d0;ַ]]
 [[א&#x5b7;]]
 [[אַ]]
-!! result
+!! html
 <p><a href="/wiki/%D7%90%D6%B7" title="אַ">&#xfb2e;</a>
 <a href="/wiki/%D7%90%D6%B7" title="אַ">&#x5d0;&#x5b7;</a>
 <a href="/wiki/%D7%90%D6%B7" title="אַ">&#x5d0;ַ</a>
 <p><a href="/wiki/%D7%90%D6%B7" title="אַ">&#xfb2e;</a>
 <a href="/wiki/%D7%90%D6%B7" title="אַ">&#x5d0;&#x5b7;</a>
 <a href="/wiki/%D7%90%D6%B7" title="אַ">&#x5d0;ַ</a>
@@ -11822,81 +12068,81 @@ The page's name is U+05d0 U+05b7, with non-canonical form U+FB2E
 
 !! test
 Empty attribute crash test (bug 2067)
 
 !! test
 Empty attribute crash test (bug 2067)
-!! input
+!! wikitext
 <font color="">foo</font>
 <font color="">foo</font>
-!! result
+!! html
 <p><font color="">foo</font>
 </p>
 !! end
 
 !! test
 Empty attribute crash test single-quotes (bug 2067)
 <p><font color="">foo</font>
 </p>
 !! end
 
 !! test
 Empty attribute crash test single-quotes (bug 2067)
-!! input
+!! wikitext
 <font color=''>foo</font>
 <font color=''>foo</font>
-!! result
+!! html
 <p><font color="">foo</font>
 </p>
 !! end
 
 !! test
 Attribute test: equals, then nothing
 <p><font color="">foo</font>
 </p>
 !! end
 
 !! test
 Attribute test: equals, then nothing
-!! input
+!! wikitext
 <font color=>foo</font>
 <font color=>foo</font>
-!! result
+!! html
 <p><font>foo</font>
 </p>
 !! end
 
 !! test
 Attribute test: unquoted value
 <p><font>foo</font>
 </p>
 !! end
 
 !! test
 Attribute test: unquoted value
-!! input
+!! wikitext
 <font color=x>foo</font>
 <font color=x>foo</font>
-!! result
+!! html
 <p><font color="x">foo</font>
 </p>
 !! end
 
 !! test
 Attribute test: unquoted but illegal value (hash)
 <p><font color="x">foo</font>
 </p>
 !! end
 
 !! test
 Attribute test: unquoted but illegal value (hash)
-!! input
+!! wikitext
 <font color=#x>foo</font>
 <font color=#x>foo</font>
-!! result
+!! html
 <p><font color="#x">foo</font>
 </p>
 !! end
 
 !! test
 Attribute test: no value
 <p><font color="#x">foo</font>
 </p>
 !! end
 
 !! test
 Attribute test: no value
-!! input
+!! wikitext
 <font color>foo</font>
 <font color>foo</font>
-!! result
+!! html
 <p><font color="color">foo</font>
 </p>
 !! end
 
 !! test
 Bug 2095: link with three closing brackets
 <p><font color="color">foo</font>
 </p>
 !! end
 
 !! test
 Bug 2095: link with three closing brackets
-!! input
+!! wikitext
 [[Main Page]]]
 [[Main Page]]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>]
 </p>
 !! end
 
 !! test
 Bug 2095: link with pipe and three closing brackets
 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>]
 </p>
 !! end
 
 !! test
 Bug 2095: link with pipe and three closing brackets
-!! input
+!! wikitext
 [[Main Page|link]]]
 [[Main Page|link]]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">link</a>]
 </p>
 !! end
 
 !! test
 Bug 2095: link with pipe and three closing brackets, version 2
 <p><a href="/wiki/Main_Page" title="Main Page">link</a>]
 </p>
 !! end
 
 !! test
 Bug 2095: link with pipe and three closing brackets, version 2
-!! input
+!! wikitext
 [[Main Page|[http://example.com/]]]
 [[Main Page|[http://example.com/]]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">[http://example.com/]</a>
 </p>
 !! end
 <p><a href="/wiki/Main_Page" title="Main Page">[http://example.com/]</a>
 </p>
 !! end
@@ -11926,90 +12172,90 @@ Template:Div style
 
 !! test
 Bug 2304: HTML attribute safety (safe template; regression bug 2309)
 
 !! test
 Bug 2304: HTML attribute safety (safe template; regression bug 2309)
-!! input
+!! wikitext
 <div title="{{test}}"></div>
 <div title="{{test}}"></div>
-!! result
+!! html
 <div title="This is a test template"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (dangerous template; 2309)
 <div title="This is a test template"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (dangerous template; 2309)
-!! input
+!! wikitext
 <div title="{{dangerous attribute}}"></div>
 <div title="{{dangerous attribute}}"></div>
-!! result
+!! html
 <div title=""></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (dangerous style template; 2309)
 <div title=""></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (dangerous style template; 2309)
-!! input
+!! wikitext
 <div style="{{dangerous style attribute}}"></div>
 <div style="{{dangerous style attribute}}"></div>
-!! result
+!! html
 <div style="/* insecure input */"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (safe parameter; 2309)
 <div style="/* insecure input */"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (safe parameter; 2309)
-!! input
+!! wikitext
 {{div style|width: 200px}}
 {{div style|width: 200px}}
-!! result
+!! html
 <div style="float: right; width: 200px">Magic div</div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (unsafe parameter; 2309)
 <div style="float: right; width: 200px">Magic div</div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (unsafe parameter; 2309)
-!! input
+!! wikitext
 {{div style|width: expression(alert(document.cookie))}}
 {{div style|width: expression(alert(document.cookie))}}
-!! result
+!! html
 <div style="/* insecure input */">Magic div</div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309)
 <div style="/* insecure input */">Magic div</div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309)
-!! input
+!! wikitext
 {{div style|"><script>alert(document.cookie)</script>}}
 {{div style|"><script>alert(document.cookie)</script>}}
-!! result
+!! html
 <div style="float: right;">&lt;script&gt;alert(document.cookie)&lt;/script&gt;"&gt;Magic div</div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309)
 <div style="float: right;">&lt;script&gt;alert(document.cookie)&lt;/script&gt;"&gt;Magic div</div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309)
-!! input
+!! wikitext
 {{div style|" ><script>alert(document.cookie)</script>}}
 {{div style|" ><script>alert(document.cookie)</script>}}
-!! result
+!! html
 <div style="float: right;">&lt;script&gt;alert(document.cookie)&lt;/script&gt;"&gt;Magic div</div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (link)
 <div style="float: right;">&lt;script&gt;alert(document.cookie)&lt;/script&gt;"&gt;Magic div</div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (link)
-!! input
+!! wikitext
 <div title="[[Main Page]]"></div>
 <div title="[[Main Page]]"></div>
-!! result
+!! html
 <div title="&#91;&#91;Main Page]]"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (italics)
 <div title="&#91;&#91;Main Page]]"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (italics)
-!! input
+!! wikitext
 <div title="''foobar''"></div>
 <div title="''foobar''"></div>
-!! result
+!! html
 <div title="&#39;&#39;foobar&#39;&#39;"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (bold)
 <div title="&#39;&#39;foobar&#39;&#39;"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (bold)
-!! input
+!! wikitext
 <div title="'''foobar'''"></div>
 <div title="'''foobar'''"></div>
-!! result
+!! html
 <div title="&#39;&#39;&#39;foobar&#39;&#39;&#39;"></div>
 
 !! end
 <div title="&#39;&#39;&#39;foobar&#39;&#39;&#39;"></div>
 
 !! end
@@ -12017,63 +12263,63 @@ Bug 2304: HTML attribute safety (bold)
 
 !! test
 Bug 2304: HTML attribute safety (ISBN)
 
 !! test
 Bug 2304: HTML attribute safety (ISBN)
-!! input
+!! wikitext
 <div title="ISBN 1234567890"></div>
 <div title="ISBN 1234567890"></div>
-!! result
+!! html
 <div title="&#73;SBN 1234567890"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (RFC)
 <div title="&#73;SBN 1234567890"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (RFC)
-!! input
+!! wikitext
 <div title="RFC 1234"></div>
 <div title="RFC 1234"></div>
-!! result
+!! html
 <div title="&#82;FC 1234"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (PMID)
 <div title="&#82;FC 1234"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (PMID)
-!! input
+!! wikitext
 <div title="PMID 1234567890"></div>
 <div title="PMID 1234567890"></div>
-!! result
+!! html
 <div title="&#80;MID 1234567890"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (web link)
 <div title="&#80;MID 1234567890"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (web link)
-!! input
+!! wikitext
 <div title="http://example.com/"></div>
 <div title="http://example.com/"></div>
-!! result
+!! html
 <div title="http&#58;//example.com/"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (named web link)
 <div title="http&#58;//example.com/"></div>
 
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (named web link)
-!! input
+!! wikitext
 <div title="[http://example.com/ link]"></div>
 <div title="[http://example.com/ link]"></div>
-!! result
+!! html
 <div title="&#91;http&#58;//example.com/ link]"></div>
 
 !! end
 
 !! test
 Bug 3244: HTML attribute safety (extension; safe)
 <div title="&#91;http&#58;//example.com/ link]"></div>
 
 !! end
 
 !! test
 Bug 3244: HTML attribute safety (extension; safe)
-!! input
+!! wikitext
 <div style="<nowiki>background:blue</nowiki>"></div>
 <div style="<nowiki>background:blue</nowiki>"></div>
-!! result
+!! html
 <div style="background:blue"></div>
 
 !! end
 
 !! test
 Bug 3244: HTML attribute safety (extension; unsafe)
 <div style="background:blue"></div>
 
 !! end
 
 !! test
 Bug 3244: HTML attribute safety (extension; unsafe)
-!! input
+!! wikitext
 <div style="<nowiki>border-left:expression(alert(document.cookie))</nowiki>"></div>
 <div style="<nowiki>border-left:expression(alert(document.cookie))</nowiki>"></div>
-!! result
+!! html
 <div style="/* insecure input */"></div>
 
 !! end
 <div style="/* insecure input */"></div>
 
 !! end
@@ -12082,55 +12328,55 @@ Bug 3244: HTML attribute safety (extension; unsafe)
 
 !! test
 MSIE CSS safety test: spurious slash
 
 !! test
 MSIE CSS safety test: spurious slash
-!! input
+!! wikitext
 <div style="background-image:u\rl(javascript:alert('boo'))">evil</div>
 <div style="background-image:u\rl(javascript:alert('boo'))">evil</div>
-!! result
+!! html
 <div style="/* insecure input */">evil</div>
 
 !! end
 
 !! test
 MSIE CSS safety test: hex code
 <div style="/* insecure input */">evil</div>
 
 !! end
 
 !! test
 MSIE CSS safety test: hex code
-!! input
+!! wikitext
 <div style="background-image:u\72l(javascript:alert('boo'))">evil</div>
 <div style="background-image:u\72l(javascript:alert('boo'))">evil</div>
-!! result
+!! html
 <div style="/* insecure input */">evil</div>
 
 !! end
 
 !! test
 MSIE CSS safety test: comment in url
 <div style="/* insecure input */">evil</div>
 
 !! end
 
 !! test
 MSIE CSS safety test: comment in url
-!! input
+!! wikitext
 <div style="background-image:u/**/rl(javascript:alert('boo'))">evil</div>
 <div style="background-image:u/**/rl(javascript:alert('boo'))">evil</div>
-!! result
+!! html
 <div style="background-image:u rl(javascript:alert(&#39;boo&#39;))">evil</div>
 
 !! end
 
 !! test
 MSIE CSS safety test: comment in expression
 <div style="background-image:u rl(javascript:alert(&#39;boo&#39;))">evil</div>
 
 !! end
 
 !! test
 MSIE CSS safety test: comment in expression
-!! input
+!! wikitext
 <div style="background-image:expres/**/sion(alert('boo4'))">evil4</div>
 <div style="background-image:expres/**/sion(alert('boo4'))">evil4</div>
-!! result
+!! html
 <div style="background-image:expres sion(alert(&#39;boo4&#39;))">evil4</div>
 
 !! end
 
 !! test
 CSS safety test (all browsers): vertical tab (bug 55332 / CVE-2013-4567)
 <div style="background-image:expres sion(alert(&#39;boo4&#39;))">evil4</div>
 
 !! end
 
 !! test
 CSS safety test (all browsers): vertical tab (bug 55332 / CVE-2013-4567)
-!! input
+!! wikitext
 <p style="font-size: 100px; background-image:url\b(https://www.google.com/images/srpr/logo6w.png)">A</p>
 <p style="font-size: 100px; background-image:url\b(https://www.google.com/images/srpr/logo6w.png)">A</p>
-!! result
+!! html
 <p style="/* invalid control char */">A</p>
 
 !! end
 
 !! test
 MSIE 6 CSS safety test: Fullwidth (bug 55332)
 <p style="/* invalid control char */">A</p>
 
 !! end
 
 !! test
 MSIE 6 CSS safety test: Fullwidth (bug 55332)
-!! input
+!! wikitext
 <p style="font-size: 100px; color: expression((title='XSSed'),'red')">A</p>
 <div style="top:EXPRESSION(alert())">B</div>
 <p style="font-size: 100px; color: expression((title='XSSed'),'red')">A</p>
 <div style="top:EXPRESSION(alert())">B</div>
-!! result
+!! html
 <p style="/* insecure input */">A</p>
 <div style="/* insecure input */">B</div>
 
 <p style="/* insecure input */">A</p>
 <div style="/* insecure input */">B</div>
 
@@ -12138,10 +12384,10 @@ MSIE 6 CSS safety test: Fullwidth (bug 55332)
 
 !! test
 MSIE 6 CSS safety test: IPA extensions (bug 55332)
 
 !! test
 MSIE 6 CSS safety test: IPA extensions (bug 55332)
-!! input
+!! wikitext
 <div style="background-image:uʀʟ(javascript:alert())">A</div>
 <p style="font-size: 100px; color: expʀessɪoɴ((title='XSSed'),'red')">B</p>
 <div style="background-image:uʀʟ(javascript:alert())">A</div>
 <p style="font-size: 100px; color: expʀessɪoɴ((title='XSSed'),'red')">B</p>
-!! result
+!! html
 <div style="/* insecure input */">A</div>
 <p style="/* insecure input */">B</p>
 
 <div style="/* insecure input */">A</div>
 <p style="/* insecure input */">B</p>
 
@@ -12149,11 +12395,11 @@ MSIE 6 CSS safety test: IPA extensions (bug 55332)
 
 !! test
 MSIE 6 CSS safety test: sup/sub script (bug 55332)
 
 !! test
 MSIE 6 CSS safety test: sup/sub script (bug 55332)
-!! input
+!! wikitext
 <div style="background-image:url⁽javascript:alert())">A</div>
 <div style="background-image:url₍javascript:alert())">B</div>
 <p style="font-size: 100px; color: expressioⁿ((title='XSSed'),'red')">C</p>
 <div style="background-image:url⁽javascript:alert())">A</div>
 <div style="background-image:url₍javascript:alert())">B</div>
 <p style="font-size: 100px; color: expressioⁿ((title='XSSed'),'red')">C</p>
-!! result
+!! html
 <div style="/* insecure input */">A</div>
 <div style="/* insecure input */">B</div>
 <p style="/* insecure input */">C</p>
 <div style="/* insecure input */">A</div>
 <div style="/* insecure input */">B</div>
 <p style="/* insecure input */">C</p>
@@ -12162,18 +12408,18 @@ MSIE 6 CSS safety test: sup/sub script (bug 55332)
 
 !! test
 Opera -o-link CSS
 
 !! test
 Opera -o-link CSS
-!! input
+!! wikitext
 <div
 title="&#100;&#97;&#116;&#97;&#58;&#116;&#101;&#120;&#116;&#47;&#104;&#116;&#109;&#108;&#44;&#60;&#105;&#109;&#103;&#32;&#115;&#114;&#99;&#61;&#49;&#32;&#111;&#110;&#101;&#114;&#114;&#111;&#114;&#61;&#97;&#108;&#101;&#114;&#116;&#40;&#49;&#41;&#62;"
 style="-o-link:attr(title);-o-link-source:current">X</div>
 <div
 title="&#100;&#97;&#116;&#97;&#58;&#116;&#101;&#120;&#116;&#47;&#104;&#116;&#109;&#108;&#44;&#60;&#105;&#109;&#103;&#32;&#115;&#114;&#99;&#61;&#49;&#32;&#111;&#110;&#101;&#114;&#114;&#111;&#114;&#61;&#97;&#108;&#101;&#114;&#116;&#40;&#49;&#41;&#62;"
 style="-o-link:attr(title);-o-link-source:current">X</div>
-!! result
+!! html
 <div title="data:text/html,&lt;img src=1 onerror=alert(1)&gt;" style="/* insecure input */">X</div>
 
 !! end
 
 !! test
 MSIE 6 CSS safety test: Repetition markers (bug 55332)
 <div title="data:text/html,&lt;img src=1 onerror=alert(1)&gt;" style="/* insecure input */">X</div>
 
 !! end
 
 !! test
 MSIE 6 CSS safety test: Repetition markers (bug 55332)
-!! input
+!! wikitext
 <p style="font-size: 100px; color: expres〱ion((title='XSSed'),'red')">A</p>
 <p style="font-size: 100px; color: expresゝion((title='XSSed'),'red')">B</p>
 <p style="font-size: 100px; color: expresーion((title='XSSed'),'red')">C</p>
 <p style="font-size: 100px; color: expres〱ion((title='XSSed'),'red')">A</p>
 <p style="font-size: 100px; color: expresゝion((title='XSSed'),'red')">B</p>
 <p style="font-size: 100px; color: expresーion((title='XSSed'),'red')">C</p>
@@ -12181,7 +12427,7 @@ MSIE 6 CSS safety test: Repetition markers (bug 55332)
 <p style="font-size: 100px; color: expresﹽion((title='XSSed'),'red')">E</p>
 <p style="font-size: 100px; color: expresﹼion((title='XSSed'),'red')">F</p>
 <p style="font-size: 100px; color: expresーion((title='XSSed'),'red')">G</p>
 <p style="font-size: 100px; color: expresﹽion((title='XSSed'),'red')">E</p>
 <p style="font-size: 100px; color: expresﹼion((title='XSSed'),'red')">F</p>
 <p style="font-size: 100px; color: expresーion((title='XSSed'),'red')">G</p>
-!! result
+!! html
 <p style="/* insecure input */">A</p>
 <p style="/* insecure input */">B</p>
 <p style="/* insecure input */">C</p>
 <p style="/* insecure input */">A</p>
 <p style="/* insecure input */">B</p>
 <p style="/* insecure input */">C</p>
@@ -12194,11 +12440,11 @@ MSIE 6 CSS safety test: Repetition markers (bug 55332)
 
 !! test
 Table attribute legitimate extension
 
 !! test
 Table attribute legitimate extension
-!! input
+!! wikitext
 {|
 !+ style="<nowiki>color:blue</nowiki>"| status
 |}
 {|
 !+ style="<nowiki>color:blue</nowiki>"| status
 |}
-!! result
+!! html
 <table>
 <tr>
 <th style="color:blue"> status
 <table>
 <tr>
 <th style="color:blue"> status
@@ -12208,11 +12454,11 @@ Table attribute legitimate extension
 
 !! test
 Table attribute safety
 
 !! test
 Table attribute safety
-!! input
+!! wikitext
 {|
 !+ style="<nowiki>border-width:expression(0+alert(document.cookie))</nowiki>"| status
 |}
 {|
 !+ style="<nowiki>border-width:expression(0+alert(document.cookie))</nowiki>"| status
 |}
-!! result
+!! html
 <table>
 <tr>
 <th style="/* insecure input */"> status
 <table>
 <tr>
 <th style="/* insecure input */"> status
@@ -12222,18 +12468,18 @@ Table attribute safety
 
 !! test
 CSS line continuation 1
 
 !! test
 CSS line continuation 1
-!! input
+!! wikitext
 <div style="background-image: u\&#10;rl(test.jpg);"></div>
 <div style="background-image: u\&#10;rl(test.jpg);"></div>
-!! result
+!! html
 <div style="/* insecure input */"></div>
 
 !! end
 
 !! test
 CSS line continuation 2
 <div style="/* insecure input */"></div>
 
 !! end
 
 !! test
 CSS line continuation 2
-!! input
+!! wikitext
 <div style="background-image: u\&#13;rl(test.jpg); "></div>
 <div style="background-image: u\&#13;rl(test.jpg); "></div>
-!! result
+!! html
 <div style="/* insecure input */"></div>
 
 !! end
 <div style="/* insecure input */"></div>
 
 !! end
@@ -12246,9 +12492,9 @@ Template:Identity
 
 !! test
 Expansion of multi-line templates in attribute values (bug 6255)
 
 !! test
 Expansion of multi-line templates in attribute values (bug 6255)
-!! input
+!! wikitext
 <div style="background: {{identity|#00FF00}}">-</div>
 <div style="background: {{identity|#00FF00}}">-</div>
-!! result
+!! html
 <div style="background: #00FF00">-</div>
 
 !! end
 <div style="background: #00FF00">-</div>
 
 !! end
@@ -12256,19 +12502,19 @@ Expansion of multi-line templates in attribute values (bug 6255)
 
 !! test
 Expansion of multi-line templates in attribute values (bug 6255 sanity check)
 
 !! test
 Expansion of multi-line templates in attribute values (bug 6255 sanity check)
-!! input
+!! wikitext
 <div style="background: 
 #00FF00">-</div>
 <div style="background: 
 #00FF00">-</div>
-!! result
+!! html
 <div style="background: #00FF00">-</div>
 
 !! end
 
 !! test
 Expansion of multi-line templates in attribute values (bug 6255 sanity check 2)
 <div style="background: #00FF00">-</div>
 
 !! end
 
 !! test
 Expansion of multi-line templates in attribute values (bug 6255 sanity check 2)
-!! input
+!! wikitext
 <div style="background: &#10;#00FF00">-</div>
 <div style="background: &#10;#00FF00">-</div>
-!! result
+!! html
 <div style="background: &#10;#00FF00">-</div>
 
 !! end
 <div style="background: &#10;#00FF00">-</div>
 
 !! end
@@ -12278,9 +12524,9 @@ Expansion of multi-line templates in attribute values (bug 6255 sanity check 2)
 ###
 !! test
 Parser hook: empty input
 ###
 !! test
 Parser hook: empty input
-!! input
+!! wikitext
 <tag></tag>
 <tag></tag>
-!! result
+!! html
 <pre>
 ''
 array (
 <pre>
 ''
 array (
@@ -12291,9 +12537,9 @@ array (
 
 !! test
 Parser hook: empty input using terminated empty elements
 
 !! test
 Parser hook: empty input using terminated empty elements
-!! input
+!! wikitext
 <tag/>
 <tag/>
-!! result
+!! html
 <pre>
 NULL
 array (
 <pre>
 NULL
 array (
@@ -12304,9 +12550,9 @@ array (
 
 !! test
 Parser hook: empty input using terminated empty elements (space before)
 
 !! test
 Parser hook: empty input using terminated empty elements (space before)
-!! input
+!! wikitext
 <tag />
 <tag />
-!! result
+!! html
 <pre>
 NULL
 array (
 <pre>
 NULL
 array (
@@ -12317,9 +12563,9 @@ array (
 
 !! test
 Parser hook: basic input
 
 !! test
 Parser hook: basic input
-!! input
+!! wikitext
 <tag>input</tag>
 <tag>input</tag>
-!! result
+!! html
 <pre>
 'input'
 array (
 <pre>
 'input'
 array (
@@ -12331,9 +12577,9 @@ array (
 
 !! test
 Parser hook: case insensitive
 
 !! test
 Parser hook: case insensitive
-!! input
+!! wikitext
 <TAG>input</TAG>
 <TAG>input</TAG>
-!! result
+!! html
 <pre>
 'input'
 array (
 <pre>
 'input'
 array (
@@ -12345,9 +12591,9 @@ array (
 
 !! test
 Parser hook: case insensitive, redux
 
 !! test
 Parser hook: case insensitive, redux
-!! input
+!! wikitext
 <TaG>input</TAg>
 <TaG>input</TAg>
-!! result
+!! html
 <pre>
 'input'
 array (
 <pre>
 'input'
 array (
@@ -12360,9 +12606,9 @@ array (
 Parser hook: nested tags
 !! options
 noxml
 Parser hook: nested tags
 !! options
 noxml
-!! input
+!! wikitext
 <tag><tag></tag></tag>
 <tag><tag></tag></tag>
-!! result
+!! html
 <pre>
 '<tag>'
 array (
 <pre>
 '<tag>'
 array (
@@ -12373,9 +12619,9 @@ array (
 
 !! test
 Parser hook: basic arguments
 
 !! test
 Parser hook: basic arguments
-!! input
+!! wikitext
 <tag width=200 height = "100" depth = '50' square></tag>
 <tag width=200 height = "100" depth = '50' square></tag>
-!! result
+!! html
 <pre>
 ''
 array (
 <pre>
 ''
 array (
@@ -12390,9 +12636,9 @@ array (
 
 !! test
 Parser hook: argument containing a forward slash (bug 5344)
 
 !! test
 Parser hook: argument containing a forward slash (bug 5344)
-!! input
+!! wikitext
 <tag filename='/tmp/bla'></tag>
 <tag filename='/tmp/bla'></tag>
-!! result
+!! html
 <pre>
 ''
 array (
 <pre>
 ''
 array (
@@ -12404,9 +12650,9 @@ array (
 
 !! test
 Parser hook: empty input using terminated empty elements (bug 2374)
 
 !! test
 Parser hook: empty input using terminated empty elements (bug 2374)
-!! input
+!! wikitext
 <tag foo=bar/>text
 <tag foo=bar/>text
-!! result
+!! html
 <pre>
 NULL
 array (
 <pre>
 NULL
 array (
@@ -12419,11 +12665,11 @@ array (
 # </tag> should be output literally since there is no matching tag that begins it
 !! test
 Parser hook: basic arguments using terminated empty elements (bug 2374)
 # </tag> should be output literally since there is no matching tag that begins it
 !! test
 Parser hook: basic arguments using terminated empty elements (bug 2374)
-!! input
+!! wikitext
 <tag width=200 height = "100" depth = '50' square/>
 other stuff
 </tag>
 <tag width=200 height = "100" depth = '50' square/>
 other stuff
 </tag>
-!! result
+!! html
 <pre>
 NULL
 array (
 <pre>
 NULL
 array (
@@ -12444,10 +12690,10 @@ array (
 
 !! test
 Parser hook: static parser hook not inside a comment
 
 !! test
 Parser hook: static parser hook not inside a comment
-!! input
+!! wikitext
 <statictag>hello, world</statictag>
 <statictag action=flush/>
 <statictag>hello, world</statictag>
 <statictag action=flush/>
-!! result
+!! html
 <p>hello, world
 </p>
 !! end
 <p>hello, world
 </p>
 !! end
@@ -12455,10 +12701,10 @@ Parser hook: static parser hook not inside a comment
 
 !! test
 Parser hook: static parser hook inside a comment
 
 !! test
 Parser hook: static parser hook inside a comment
-!! input
+!! wikitext
 <!-- <statictag>hello, world</statictag> -->
 <statictag action=flush/>
 <!-- <statictag>hello, world</statictag> -->
 <statictag action=flush/>
-!! result
+!! html
 <p><br />
 </p>
 !! end
 <p><br />
 </p>
 !! end
@@ -12480,9 +12726,9 @@ Template:Map-one-parameter
 
 !! test
 Nested template calls
 
 !! test
 Nested template calls
-!! input
+!! wikitext
 {{Map-one-parameter|One-parameter|param}}
 {{Map-one-parameter|One-parameter|param}}
-!! result
+!! html
 <p>(My parameter is: param)
 </p>
 !! end
 <p>(My parameter is: param)
 </p>
 !! end
@@ -12493,45 +12739,45 @@ Nested template calls
 ###
 !! test
 Sanitizer: Closing of open tags
 ###
 !! test
 Sanitizer: Closing of open tags
-!! input
+!! wikitext
 <s></s><table></table>
 <s></s><table></table>
-!! result
+!! html
 <s></s><table></table>
 
 !! end
 
 !! test
 Sanitizer: Closing of open but not closed tags
 <s></s><table></table>
 
 !! end
 
 !! test
 Sanitizer: Closing of open but not closed tags
-!! input
+!! wikitext
 <s>foo
 <s>foo
-!! result
+!! html
 <p><s>foo</s>
 </p>
 !! end
 
 !! test
 Sanitizer: Closing of closed but not open tags
 <p><s>foo</s>
 </p>
 !! end
 
 !! test
 Sanitizer: Closing of closed but not open tags
-!! input
+!! wikitext
 </s>
 </s>
-!! result
+!! html
 <p>&lt;/s&gt;
 </p>
 !! end
 
 !! test
 Sanitizer: Closing of closed but not open table tags
 <p>&lt;/s&gt;
 </p>
 !! end
 
 !! test
 Sanitizer: Closing of closed but not open table tags
-!! input
+!! wikitext
 Table not started</td></tr></table>
 Table not started</td></tr></table>
-!! result
+!! html
 <p>Table not started&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
 </p>
 !! end
 
 !! test
 Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id=""
 <p>Table not started&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
 </p>
 !! end
 
 !! test
 Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id=""
-!! input
+!! wikitext
 <span id="æ: v">byte</span>[[#æ: v|backlink]]
 <span id="æ: v">byte</span>[[#æ: v|backlink]]
-!! result
+!! html
 <p><span id=".C3.A6:_v">byte</span><a href="#.C3.A6:_v">backlink</a>
 </p>
 !! end
 <p><span id=".C3.A6:_v">byte</span><a href="#.C3.A6:_v">backlink</a>
 </p>
 !! end
@@ -12540,9 +12786,9 @@ Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id=
 Sanitizer: Validating the contents of the id attribute (bug 4515)
 !! options
 disabled
 Sanitizer: Validating the contents of the id attribute (bug 4515)
 !! options
 disabled
-!! input
+!! wikitext
 <br id=9 />
 <br id=9 />
-!! result
+!! html
 Something, but definitely not <br id="9" />...
 !! end
 
 Something, but definitely not <br id="9" />...
 !! end
 
@@ -12550,15 +12796,15 @@ Something, but definitely not <br id="9" />...
 Sanitizer: Validating id attribute uniqueness (bug 4515, bug 6301)
 !! options
 disabled
 Sanitizer: Validating id attribute uniqueness (bug 4515, bug 6301)
 !! options
 disabled
-!! input
+!! wikitext
 <br id="foo" /><br id="foo" />
 <br id="foo" /><br id="foo" />
-!! result
+!! html
 Something need to be done. foo-2 ? 
 !! end
 
 !! test
 Sanitizer: Validating that <meta> and <link> work, but only for Microdata
 Something need to be done. foo-2 ? 
 !! end
 
 !! test
 Sanitizer: Validating that <meta> and <link> work, but only for Microdata
-!! input
+!! wikitext
 <div itemscope>
        <meta itemprop="hello" content="world">
        <meta http-equiv="refresh" content="5">
 <div itemscope>
        <meta itemprop="hello" content="world">
        <meta http-equiv="refresh" content="5">
@@ -12567,7 +12813,7 @@ Sanitizer: Validating that <meta> and <link> work, but only for Microdata
        <link rel="stylesheet" href="{{SERVER}}">
        <link rel="stylesheet" itemprop="hello" href="{{SERVER}}">
 </div>
        <link rel="stylesheet" href="{{SERVER}}">
        <link rel="stylesheet" itemprop="hello" href="{{SERVER}}">
 </div>
-!! result
+!! html
 <div itemscope="itemscope">
 <p>    <meta itemprop="hello" content="world" />
        &lt;meta http-equiv="refresh" content="5"&gt;
 <div itemscope="itemscope">
 <p>    <meta itemprop="hello" content="world" />
        &lt;meta http-equiv="refresh" content="5"&gt;
@@ -12584,7 +12830,7 @@ Sanitizer: Validating that <meta> and <link> work, but only for Microdata
 Language converter: output gets cut off unexpectedly (bug 5757)
 !! options
 language=zh
 Language converter: output gets cut off unexpectedly (bug 5757)
 !! options
 language=zh
-!! input
+!! wikitext
 this bit is safe: }-
 
 but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}-
 this bit is safe: }-
 
 but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}-
@@ -12592,7 +12838,7 @@ but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}-
 then we get cut off here: }-
 
 all additional text is vanished
 then we get cut off here: }-
 
 all additional text is vanished
-!! result
+!! html
 <p>this bit is safe: }-
 </p><p>but if we add a conversion instance: xxx
 </p><p>then we get cut off here: }-
 <p>this bit is safe: }-
 </p><p>but if we add a conversion instance: xxx
 </p><p>then we get cut off here: }-
@@ -12603,10 +12849,10 @@ all additional text is vanished
 !! test
 Self closed html pairs (bug 5487)
 !! options
 !! test
 Self closed html pairs (bug 5487)
 !! options
-!! input
+!! wikitext
 <center><font id="bug" />Centered text</center>
 <div><font id="bug2" />In div text</div>
 <center><font id="bug" />Centered text</center>
 <div><font id="bug2" />In div text</div>
-!! result
+!! html
 <center>&lt;font id="bug" /&gt;Centered text</center>
 <div>&lt;font id="bug2" /&gt;In div text</div>
 
 <center>&lt;font id="bug" /&gt;Centered text</center>
 <div>&lt;font id="bug2" /&gt;In div text</div>
 
@@ -12618,27 +12864,27 @@ Self closed html pairs (bug 5487)
 
 !! test
 Punctuation: nbsp before exclamation
 
 !! test
 Punctuation: nbsp before exclamation
-!! input
+!! wikitext
 C'est grave !
 C'est grave !
-!! result
+!! html
 <p>C'est grave&#160;!
 </p>
 !! end
 
 !! test
 Punctuation: CSS !important (bug 11874)
 <p>C'est grave&#160;!
 </p>
 !! end
 
 !! test
 Punctuation: CSS !important (bug 11874)
-!! input
+!! wikitext
 <div style="width:50% !important">important</div>
 <div style="width:50% !important">important</div>
-!! result
+!! html
 <div style="width:50% !important">important</div>
 
 !!end
 
 !! test
 Punctuation: CSS ! important (bug 11874; with space after)
 <div style="width:50% !important">important</div>
 
 !!end
 
 !! test
 Punctuation: CSS ! important (bug 11874; with space after)
-!! input
+!! wikitext
 <div style="width:50% ! important">important</div>
 <div style="width:50% ! important">important</div>
-!! result
+!! html
 <div style="width:50% ! important">important</div>
 
 !!end
 <div style="width:50% ! important">important</div>
 
 !!end
@@ -12646,12 +12892,12 @@ Punctuation: CSS ! important (bug 11874; with space after)
 
 !! test
 HTML bullet list, closed tags (bug 5497)
 
 !! test
 HTML bullet list, closed tags (bug 5497)
-!! input
+!! wikitext
 <ul>
 <li>One</li>
 <li>Two</li>
 </ul>
 <ul>
 <li>One</li>
 <li>Two</li>
 </ul>
-!! result
+!! html
 <ul>
 <li>One</li>
 <li>Two</li>
 <ul>
 <li>One</li>
 <li>Two</li>
@@ -12663,12 +12909,12 @@ HTML bullet list, closed tags (bug 5497)
 HTML bullet list, unclosed tags (bug 5497)
 !! options
 disabled
 HTML bullet list, unclosed tags (bug 5497)
 !! options
 disabled
-!! input
+!! wikitext
 <ul>
 <li>One
 <li>Two
 </ul>
 <ul>
 <li>One
 <li>Two
 </ul>
-!! result
+!! html
 <ul>
 <li>One
 </li>
 <ul>
 <li>One
 </li>
@@ -12680,12 +12926,12 @@ disabled
 
 !! test
 HTML ordered list, closed tags (bug 5497)
 
 !! test
 HTML ordered list, closed tags (bug 5497)
-!! input
+!! wikitext
 <ol>
 <li>One</li>
 <li>Two</li>
 </ol>
 <ol>
 <li>One</li>
 <li>Two</li>
 </ol>
-!! result
+!! html
 <ol>
 <li>One</li>
 <li>Two</li>
 <ol>
 <li>One</li>
 <li>Two</li>
@@ -12697,12 +12943,12 @@ HTML ordered list, closed tags (bug 5497)
 HTML ordered list, unclosed tags (bug 5497)
 !! options
 disabled
 HTML ordered list, unclosed tags (bug 5497)
 !! options
 disabled
-!! input
+!! wikitext
 <ol>
 <li>One
 <li>Two
 </ol>
 <ol>
 <li>One
 <li>Two
 </ol>
-!! result
+!! html
 <ol>
 <li>One
 </li>
 <ol>
 <li>One
 </li>
@@ -12714,7 +12960,7 @@ disabled
 
 !! test
 HTML nested bullet list, closed tags (bug 5497)
 
 !! test
 HTML nested bullet list, closed tags (bug 5497)
-!! input
+!! wikitext
 <ul>
 <li>One</li>
 <li>Two:
 <ul>
 <li>One</li>
 <li>Two:
@@ -12724,7 +12970,7 @@ HTML nested bullet list, closed tags (bug 5497)
 </ul>
 </li>
 </ul>
 </ul>
 </li>
 </ul>
-!! result
+!! html
 <ul>
 <li>One</li>
 <li>Two:
 <ul>
 <li>One</li>
 <li>Two:
@@ -12741,7 +12987,7 @@ HTML nested bullet list, closed tags (bug 5497)
 HTML nested bullet list, open tags (bug 5497)
 !! options
 disabled
 HTML nested bullet list, open tags (bug 5497)
 !! options
 disabled
-!! input
+!! wikitext
 <ul>
 <li>One
 <li>Two:
 <ul>
 <li>One
 <li>Two:
@@ -12750,7 +12996,7 @@ disabled
 <li>Sub-two
 </ul>
 </ul>
 <li>Sub-two
 </ul>
 </ul>
-!! result
+!! html
 <ul>
 <li>One
 </li>
 <ul>
 <li>One
 </li>
@@ -12768,7 +13014,7 @@ disabled
 
 !! test
 HTML nested ordered list, closed tags (bug 5497)
 
 !! test
 HTML nested ordered list, closed tags (bug 5497)
-!! input
+!! wikitext
 <ol>
 <li>One</li>
 <li>Two:
 <ol>
 <li>One</li>
 <li>Two:
@@ -12778,7 +13024,7 @@ HTML nested ordered list, closed tags (bug 5497)
 </ol>
 </li>
 </ol>
 </ol>
 </li>
 </ol>
-!! result
+!! html
 <ol>
 <li>One</li>
 <li>Two:
 <ol>
 <li>One</li>
 <li>Two:
@@ -12795,7 +13041,7 @@ HTML nested ordered list, closed tags (bug 5497)
 HTML nested ordered list, open tags (bug 5497)
 !! options
 disabled
 HTML nested ordered list, open tags (bug 5497)
 !! options
 disabled
-!! input
+!! wikitext
 <ol>
 <li>One
 <li>Two:
 <ol>
 <li>One
 <li>Two:
@@ -12804,7 +13050,7 @@ disabled
 <li>Sub-two
 </ol>
 </ol>
 <li>Sub-two
 </ol>
 </ol>
-!! result
+!! html
 <ol>
 <li>One
 </li>
 <ol>
 <li>One
 </li>
@@ -12822,10 +13068,10 @@ disabled
 
 !! test
 HTML ordered list item with parameters oddity
 
 !! test
 HTML ordered list item with parameters oddity
-!! input
+!! wikitext
 <ol><li id="fragment">One</li>
 </ol>
 <ol><li id="fragment">One</li>
 </ol>
-!! result
+!! html
 <ol><li id="fragment">One</li>
 </ol>
 
 <ol><li id="fragment">One</li>
 </ol>
 
@@ -12833,7 +13079,7 @@ HTML ordered list item with parameters oddity
 
 !!test
 bug 5918: autonumbering
 
 !!test
 bug 5918: autonumbering
-!! input
+!! wikitext
 [http://first/] [http://second] [ftp://ftp]
 
 ftp://inlineftp
 [http://first/] [http://second] [ftp://ftp]
 
 ftp://inlineftp
@@ -12843,7 +13089,7 @@ ftp://inlineftp
 [mailto:enclosed@mail.tld]
 
 mailto:inline@mail.tld
 [mailto:enclosed@mail.tld]
 
 mailto:inline@mail.tld
-!! result
+!! html
 <p><a rel="nofollow" class="external autonumber" href="http://first/">[1]</a> <a rel="nofollow" class="external autonumber" href="http://second">[2]</a> <a rel="nofollow" class="external autonumber" href="ftp://ftp">[3]</a>
 </p><p><a rel="nofollow" class="external free" href="ftp://inlineftp">ftp://inlineftp</a>
 </p><p><a rel="nofollow" class="external text" href="mailto:enclosed@mail.tld">With target</a>
 <p><a rel="nofollow" class="external autonumber" href="http://first/">[1]</a> <a rel="nofollow" class="external autonumber" href="http://second">[2]</a> <a rel="nofollow" class="external autonumber" href="ftp://ftp">[3]</a>
 </p><p><a rel="nofollow" class="external free" href="ftp://inlineftp">ftp://inlineftp</a>
 </p><p><a rel="nofollow" class="external text" href="mailto:enclosed@mail.tld">With target</a>
@@ -12860,10 +13106,10 @@ mailto:inline@mail.tld
 
 !! test
 Fuzz testing: Parser13
 
 !! test
 Fuzz testing: Parser13
-!! input
+!! wikitext
 {| 
 | http://a|
 {| 
 | http://a|
-!! result
+!! html
 <table>
 <tr>
 <td>
 <table>
 <tr>
 <td>
@@ -12875,10 +13121,10 @@ Fuzz testing: Parser13
 
 !! test
 Fuzz testing: Parser14
 
 !! test
 Fuzz testing: Parser14
-!! input
+!! wikitext
 == onmouseover= ==
 http://__TOC__
 == onmouseover= ==
 http://__TOC__
-!! result
+!! html
 <h2><span class="mw-headline" id="onmouseover.3D">onmouseover=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: onmouseover=">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 http://<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <h2><span class="mw-headline" id="onmouseover.3D">onmouseover=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: onmouseover=">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 http://<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
@@ -12891,10 +13137,10 @@ http://<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 
 !! test
 Fuzz testing: Parser14-table
 
 !! test
 Fuzz testing: Parser14-table
-!! input
+!! wikitext
 ==a==
 {| STYLE=__TOC__
 ==a==
 {| STYLE=__TOC__
-!! result
+!! html
 <h2><span class="mw-headline" id="a">a</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: a">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <table style="&#95;_TOC&#95;_">
 <tr><td></td></tr>
 <h2><span class="mw-headline" id="a">a</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: a">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <table style="&#95;_TOC&#95;_">
 <tr><td></td></tr>
@@ -12907,10 +13153,10 @@ Fuzz testing: Parser14-table
 Fuzz testing: Parser16
 !! options
 noxml
 Fuzz testing: Parser16
 !! options
 noxml
-!! input
+!! wikitext
 {|
 !https://||||||
 {|
 !https://||||||
-!! result
+!! html
 <table>
 <tr>
 <th>https://</th>
 <table>
 <tr>
 <th>https://</th>
@@ -12925,11 +13171,11 @@ noxml
 
 !! test
 Fuzz testing: Parser21
 
 !! test
 Fuzz testing: Parser21
-!! input
+!! wikitext
 {|
 ! irc://{{ftp://a" onmouseover="alert('hello world');"
 |
 {|
 ! irc://{{ftp://a" onmouseover="alert('hello world');"
 |
-!! result
+!! html
 <table>
 <tr>
 <th> <a rel="nofollow" class="external free" href="irc://{{ftp://a">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
 <table>
 <tr>
 <th> <a rel="nofollow" class="external free" href="irc://{{ftp://a">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
@@ -12943,11 +13189,11 @@ Fuzz testing: Parser21
 
 !! test
 Fuzz testing: Parser22
 
 !! test
 Fuzz testing: Parser22
-!! input
+!! wikitext
 http://===r:::https://b
 
 {|
 http://===r:::https://b
 
 {|
-!!result
+!! html
 <p><a rel="nofollow" class="external free" href="http://===r:::https://b">http://===r:::https://b</a>
 </p>
 <table>
 <p><a rel="nofollow" class="external free" href="http://===r:::https://b">http://===r:::https://b</a>
 </p>
 <table>
@@ -12961,7 +13207,7 @@ http://===r:::https://b
 Fuzz testing: Parser24
 !! options
 noxml
 Fuzz testing: Parser24
 !! options
 noxml
-!! input
+!! wikitext
 {|
 {{{|
 <u CLASS=
 {|
 {{{|
 <u CLASS=
@@ -12970,7 +13216,7 @@ noxml
 
 MOVE YOUR MOUSE CURSOR OVER THIS TEXT
 |
 
 MOVE YOUR MOUSE CURSOR OVER THIS TEXT
 |
-!! result
+!! html
 <table>
 {{{|
 <u class="&#124;">}}}} &gt;
 <table>
 {{{|
 <u class="&#124;">}}}} &gt;
@@ -12995,13 +13241,13 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT
 # }}}blah" onmouseover="alert('hello world');" align="left"<b>MOVE MOUSE CURSOR OVER HERE</b>
 !!test
 Fuzz testing: Parser25 (bug 6055)
 # }}}blah" onmouseover="alert('hello world');" align="left"<b>MOVE MOUSE CURSOR OVER HERE</b>
 !!test
 Fuzz testing: Parser25 (bug 6055)
-!! input
+!! wikitext
 {{{
 | 
 <LI CLASS=||
  >
 }}}blah" onmouseover="alert('hello world');" align="left"'''MOVE MOUSE CURSOR OVER HERE
 {{{
 | 
 <LI CLASS=||
  >
 }}}blah" onmouseover="alert('hello world');" align="left"'''MOVE MOUSE CURSOR OVER HERE
-!! result
+!! html
 <p>&lt;LI CLASS=blah" onmouseover="alert('hello world');" align="left"<b>MOVE MOUSE CURSOR OVER HERE</b>
 </p>
 !! end
 <p>&lt;LI CLASS=blah" onmouseover="alert('hello world');" align="left"<b>MOVE MOUSE CURSOR OVER HERE</b>
 </p>
 !! end
@@ -13009,9 +13255,9 @@ Fuzz testing: Parser25 (bug 6055)
 !!test
 Fuzz testing: URL adjacent extension (with space, clean)
 !! options
 !!test
 Fuzz testing: URL adjacent extension (with space, clean)
 !! options
-!! input
+!! wikitext
 http://example.com <nowiki>junk</nowiki>
 http://example.com <nowiki>junk</nowiki>
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> junk
 </p>
 !!end
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> junk
 </p>
 !!end
@@ -13019,9 +13265,9 @@ http://example.com <nowiki>junk</nowiki>
 !!test
 Fuzz testing: URL adjacent extension (no space, dirty; nowiki)
 !! options
 !!test
 Fuzz testing: URL adjacent extension (no space, dirty; nowiki)
 !! options
-!! input
+!! wikitext
 http://example.com<nowiki>junk</nowiki>
 http://example.com<nowiki>junk</nowiki>
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>junk
 </p>
 !!end
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>junk
 </p>
 !!end
@@ -13029,27 +13275,29 @@ http://example.com<nowiki>junk</nowiki>
 !!test
 Fuzz testing: URL adjacent extension (no space, dirty; pre)
 !! options
 !!test
 Fuzz testing: URL adjacent extension (no space, dirty; pre)
 !! options
-!! input
+!! wikitext
 http://example.com<pre>junk</pre>
 http://example.com<pre>junk</pre>
-!! result
+!! html
 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><pre>junk</pre>
 
 !!end
 
 !!test
 Fuzz testing: image with bogus manual thumbnail
 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><pre>junk</pre>
 
 !!end
 
 !!test
 Fuzz testing: image with bogus manual thumbnail
-!!input
+!! wikitext
 [[Image:foobar.jpg|thumbnail= ]]
 [[Image:foobar.jpg|thumbnail= ]]
-!!result
+!! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;">Error creating thumbnail:   <div class="thumbcaption"></div></div></div>
 
 <div class="thumb tright"><div class="thumbinner" style="width:182px;">Error creating thumbnail:   <div class="thumbcaption"></div></div></div>
 
+!! html/parsoid
+<meta typeof="mw:Placeholder" data-parsoid='{"src":"[[Image:foobar.jpg|thumbnail= ]]","optList":[{"ck":"manualthumb","ak":"thumbnail= "}],"dsr":[0,32,null,null]}'/>
 !!end
 
 !! test
 Fuzz testing: encoded newline in generated HTML replacements (bug 6577)
 !!end
 
 !! test
 Fuzz testing: encoded newline in generated HTML replacements (bug 6577)
-!! input
+!! wikitext
 <pre dir="&#10;"></pre>
 <pre dir="&#10;"></pre>
-!! result
+!! html
 <pre dir="&#10;"></pre>
 
 !! end
 <pre dir="&#10;"></pre>
 
 !! end
@@ -13057,7 +13305,7 @@ Fuzz testing: encoded newline in generated HTML replacements (bug 6577)
 !! test
 Parsing optional HTML elements (Bug 6171)
 !! options
 !! test
 Parsing optional HTML elements (Bug 6171)
 !! options
-!! input
+!! wikitext
 <table>
   <tr>
     <td> Some tabular data</td>
 <table>
   <tr>
     <td> Some tabular data</td>
@@ -13065,7 +13313,7 @@ Parsing optional HTML elements (Bug 6171)
     <td> And yet som tabular data</td>
   </tr>
 </table>
     <td> And yet som tabular data</td>
   </tr>
 </table>
-!! result
+!! html
 <table>
   <tr>
     <td> Some tabular data</td>
 <table>
   <tr>
     <td> Some tabular data</td>
@@ -13079,7 +13327,7 @@ Parsing optional HTML elements (Bug 6171)
 !! test
 Correct handling of <td>, <tr> (Bug 6171)
 !! options
 !! test
 Correct handling of <td>, <tr> (Bug 6171)
 !! options
-!! input
+!! wikitext
 <table>
   <tr>
     <td> Some tabular data</td>
 <table>
   <tr>
     <td> Some tabular data</td>
@@ -13087,7 +13335,7 @@ Correct handling of <td>, <tr> (Bug 6171)
     <td> And yet som tabular data</td>
   </tr>
 </table>
     <td> And yet som tabular data</td>
   </tr>
 </table>
-!! result
+!! html
 <table>
   <tr>
     <td> Some tabular data</td>
 <table>
   <tr>
     <td> Some tabular data</td>
@@ -13101,20 +13349,20 @@ Correct handling of <td>, <tr> (Bug 6171)
 
 !! test
 Parsing crashing regression (fr:JavaScript)
 
 !! test
 Parsing crashing regression (fr:JavaScript)
-!! input
+!! wikitext
 </body></x>
 </body></x>
-!! result
+!! html
 <p>&lt;/body&gt;&lt;/x&gt;
 </p>
 !! end
 
 !! test
 Inline wiki vs wiki block nesting
 <p>&lt;/body&gt;&lt;/x&gt;
 </p>
 !! end
 
 !! test
 Inline wiki vs wiki block nesting
-!! input
+!! wikitext
 '''Bold paragraph
 
 New wiki paragraph
 '''Bold paragraph
 
 New wiki paragraph
-!! result
+!! html
 <p><b>Bold paragraph</b>
 </p><p>New wiki paragraph
 </p>
 <p><b>Bold paragraph</b>
 </p><p>New wiki paragraph
 </p>
@@ -13124,11 +13372,11 @@ New wiki paragraph
 Inline HTML vs wiki block nesting
 !! options
 disabled
 Inline HTML vs wiki block nesting
 !! options
 disabled
-!! input
+!! wikitext
 <b>Bold paragraph
 
 New wiki paragraph
 <b>Bold paragraph
 
 New wiki paragraph
-!! result
+!! html
 <p><b>Bold paragraph</b>
 </p><p>New wiki paragraph
 </p>
 <p><b>Bold paragraph</b>
 </p><p>New wiki paragraph
 </p>
@@ -13143,9 +13391,9 @@ New wiki paragraph
 !!test
 Mixing markup for italics and bold
 !! options
 !!test
 Mixing markup for italics and bold
 !! options
-!! input
+!! wikitext
 '''bold''''''bold''bolditalics'''''
 '''bold''''''bold''bolditalics'''''
-!! result
+!! html
 <p>'<i>bold'</i><b>bold<i>bolditalics</i></b>
 </p>
 !! end
 <p>'<i>bold'</i><b>bold<i>bolditalics</i></b>
 </p>
 !! end
@@ -13160,66 +13408,66 @@ Article for special page transclusion test
 !! test
 Special page transclusion
 !! options
 !! test
 Special page transclusion
 !! options
-!! input
+!! wikitext
 {{Special:Prefixindex/Xyzzyx}}
 {{Special:Prefixindex/Xyzzyx}}
-!! result
-<table id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
+!! html
+<table class="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
 
 !! end
 
 !! test
 Special page transclusion twice (bug 5021)
 !! options
 
 !! end
 
 !! test
 Special page transclusion twice (bug 5021)
 !! options
-!! input
+!! wikitext
 {{Special:Prefixindex/Xyzzyx}}
 {{Special:Prefixindex/Xyzzyx}}
 {{Special:Prefixindex/Xyzzyx}}
 {{Special:Prefixindex/Xyzzyx}}
-!! result
-<table id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
-<table id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
+!! html
+<table class="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
+<table class="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
 
 !! end
 
 !! test
 Transclusion of default MediaWiki message
 
 !! end
 
 !! test
 Transclusion of default MediaWiki message
-!! input
+!! wikitext
 {{MediaWiki:Mainpage}}
 {{MediaWiki:Mainpage}}
-!!result
+!! html
 <p>Main Page
 </p>
 !! end
 
 !! test
 Transclusion of nonexistent MediaWiki message
 <p>Main Page
 </p>
 !! end
 
 !! test
 Transclusion of nonexistent MediaWiki message
-!! input
+!! wikitext
 {{MediaWiki:Mainpagexxx}}
 {{MediaWiki:Mainpagexxx}}
-!!result
+!! html
 <p><a href="/index.php?title=MediaWiki:Mainpagexxx&amp;action=edit&amp;redlink=1" class="new" title="MediaWiki:Mainpagexxx (page does not exist)">MediaWiki:Mainpagexxx</a>
 </p>
 !! end
 
 !! test
 Transclusion of MediaWiki message with underscore
 <p><a href="/index.php?title=MediaWiki:Mainpagexxx&amp;action=edit&amp;redlink=1" class="new" title="MediaWiki:Mainpagexxx (page does not exist)">MediaWiki:Mainpagexxx</a>
 </p>
 !! end
 
 !! test
 Transclusion of MediaWiki message with underscore
-!! input
+!! wikitext
 {{MediaWiki:history_short}}
 {{MediaWiki:history_short}}
-!! result
+!! html
 <p>History
 </p>
 !! end
 
 !! test
 Transclusion of MediaWiki message with space
 <p>History
 </p>
 !! end
 
 !! test
 Transclusion of MediaWiki message with space
-!! input
+!! wikitext
 {{MediaWiki:history short}}
 {{MediaWiki:history short}}
-!! result
+!! html
 <p>History
 </p>
 !! end
 
 !! test
 Invalid header with following text
 <p>History
 </p>
 !! end
 
 !! test
 Invalid header with following text
-!! input
+!! wikitext
 = x = y
 = x = y
-!! result
+!! html
 <p>= x = y
 </p>
 !! end
 <p>= x = y
 </p>
 !! end
@@ -13229,7 +13477,7 @@ Invalid header with following text
 Section extraction test (section 0)
 !! options
 section=0
 Section extraction test (section 0)
 !! options
 section=0
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13241,7 +13489,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 !! end
 
 start
 !! end
 
@@ -13249,7 +13497,7 @@ start
 Section extraction test (section 1)
 !! options
 section=1
 Section extraction test (section 1)
 !! options
 section=1
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13261,7 +13509,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 ==a==
 ===aa===
 ====aaa====
 ==a==
 ===aa===
 ====aaa====
@@ -13271,7 +13519,7 @@ start
 Section extraction test (section 2)
 !! options
 section=2
 Section extraction test (section 2)
 !! options
 section=2
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13283,7 +13531,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 ===aa===
 ====aaa====
 !! end
 ===aa===
 ====aaa====
 !! end
@@ -13292,7 +13540,7 @@ start
 Section extraction test (section 3)
 !! options
 section=3
 Section extraction test (section 3)
 !! options
 section=3
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13304,7 +13552,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 ====aaa====
 !! end
 
 ====aaa====
 !! end
 
@@ -13312,7 +13560,7 @@ start
 Section extraction test (section 4)
 !! options
 section=4
 Section extraction test (section 4)
 !! options
 section=4
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13324,7 +13572,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 ==b==
 ===ba===
 ===bb===
 ==b==
 ===ba===
 ===bb===
@@ -13336,7 +13584,7 @@ start
 Section extraction test (section 5)
 !! options
 section=5
 Section extraction test (section 5)
 !! options
 section=5
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13348,7 +13596,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 ===ba===
 !! end
 
 ===ba===
 !! end
 
@@ -13356,7 +13604,7 @@ start
 Section extraction test (section 6)
 !! options
 section=6
 Section extraction test (section 6)
 !! options
 section=6
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13368,7 +13616,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 ===bb===
 ====bba====
 !! end
 ===bb===
 ====bba====
 !! end
@@ -13377,7 +13625,7 @@ start
 Section extraction test (section 7)
 !! options
 section=7
 Section extraction test (section 7)
 !! options
 section=7
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13389,7 +13637,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 ====bba====
 !! end
 
 ====bba====
 !! end
 
@@ -13397,7 +13645,7 @@ start
 Section extraction test (section 8)
 !! options
 section=8
 Section extraction test (section 8)
 !! options
 section=8
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13409,7 +13657,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 ===bc===
 !! end
 
 ===bc===
 !! end
 
@@ -13417,7 +13665,7 @@ start
 Section extraction test (section 9)
 !! options
 section=9
 Section extraction test (section 9)
 !! options
 section=9
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13429,7 +13677,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 ==c==
 ===ca===
 !! end
 ==c==
 ===ca===
 !! end
@@ -13438,7 +13686,7 @@ start
 Section extraction test (section 10)
 !! options
 section=10
 Section extraction test (section 10)
 !! options
 section=10
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13450,7 +13698,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 ===ca===
 !! end
 
 ===ca===
 !! end
 
@@ -13458,7 +13706,7 @@ start
 Section extraction test (nonexistent section 11)
 !! options
 section=11
 Section extraction test (nonexistent section 11)
 !! options
 section=11
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13470,18 +13718,18 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 !! end
 
 !! test
 Section extraction test with bogus heading (section 1)
 !! options
 section=1
 !! end
 
 !! test
 Section extraction test with bogus heading (section 1)
 !! options
 section=1
-!! input
+!! wikitext
 ==a==
 ==bogus== not a legal section
 ==b==
 ==a==
 ==bogus== not a legal section
 ==b==
-!! result
+!! html
 ==a==
 ==bogus== not a legal section
 !! end
 ==a==
 ==bogus== not a legal section
 !! end
@@ -13490,11 +13738,11 @@ section=1
 Section extraction test with bogus heading (section 2)
 !! options
 section=2
 Section extraction test with bogus heading (section 2)
 !! options
 section=2
-!! input
+!! wikitext
 ==a==
 ==bogus== not a legal section
 ==b==
 ==a==
 ==bogus== not a legal section
 ==b==
-!! result
+!! html
 ==b==
 !! end
 
 ==b==
 !! end
 
@@ -13502,11 +13750,11 @@ section=2
 Section extraction test with comment after heading (section 1)
 !! options
 section=1
 Section extraction test with comment after heading (section 1)
 !! options
 section=1
-!! input
+!! wikitext
 ==a==
 ==b== <!-- -->
 ==c==
 ==a==
 ==b== <!-- -->
 ==c==
-!! result
+!! html
 ==a==
 !! end
 
 ==a==
 !! end
 
@@ -13514,11 +13762,11 @@ section=1
 Section extraction test with comment after heading (section 2)
 !! options
 section=2
 Section extraction test with comment after heading (section 2)
 !! options
 section=2
-!! input
+!! wikitext
 ==a==
 ==b== <!-- -->
 ==c==
 ==a==
 ==b== <!-- -->
 ==c==
-!! result
+!! html
 ==b== <!-- -->
 !! end
 
 ==b== <!-- -->
 !! end
 
@@ -13526,11 +13774,11 @@ section=2
 Section extraction test with bogus <nowiki> heading (section 1)
 !! options
 section=1
 Section extraction test with bogus <nowiki> heading (section 1)
 !! options
 section=1
-!! input
+!! wikitext
 ==a==
 ==bogus== <nowiki>not a legal section</nowiki>
 ==b==
 ==a==
 ==bogus== <nowiki>not a legal section</nowiki>
 ==b==
-!! result
+!! html
 ==a==
 ==bogus== <nowiki>not a legal section</nowiki>
 !! end
 ==a==
 ==bogus== <nowiki>not a legal section</nowiki>
 !! end
@@ -13539,11 +13787,11 @@ section=1
 Section extraction test with bogus <nowiki> heading (section 2)
 !! options
 section=2
 Section extraction test with bogus <nowiki> heading (section 2)
 !! options
 section=2
-!! input
+!! wikitext
 ==a==
 ==bogus== <nowiki>not a legal section</nowiki>
 ==b==
 ==a==
 ==bogus== <nowiki>not a legal section</nowiki>
 ==b==
-!! result
+!! html
 ==b==
 !! end
 
 ==b==
 !! end
 
@@ -13554,10 +13802,10 @@ section=2
 Section extraction prefixed by comment (section 1)
 !! options
 section=1
 Section extraction prefixed by comment (section 1)
 !! options
 section=1
-!! input
+!! wikitext
 <!-- -->==sec1==
 ==sec2==
 <!-- -->==sec1==
 ==sec2==
-!!result
+!! html
 ==sec2==
 !!end
 
 ==sec2==
 !!end
 
@@ -13565,10 +13813,10 @@ section=1
 Section extraction prefixed by comment (section 2)
 !! options
 section=2
 Section extraction prefixed by comment (section 2)
 !! options
 section=2
-!! input
+!! wikitext
 <!-- -->==sec1==
 ==sec2==
 <!-- -->==sec1==
 ==sec2==
-!!result
+!! html
 
 !!end
 
 
 !!end
 
@@ -13579,14 +13827,14 @@ section=2
 Section extraction, mixed wiki and html (section 1)
 !! options
 section=1
 Section extraction, mixed wiki and html (section 1)
 !! options
 section=1
-!! input
+!! wikitext
 <h2>unmarked</h2>
 unmarked
 ==1==
 one
 ==2==
 two
 <h2>unmarked</h2>
 unmarked
 ==1==
 one
 ==2==
 two
-!! result
+!! html
 ==1==
 one
 !! end
 ==1==
 one
 !! end
@@ -13595,14 +13843,14 @@ one
 Section extraction, mixed wiki and html (section 2)
 !! options
 section=2
 Section extraction, mixed wiki and html (section 2)
 !! options
 section=2
-!! input
+!! wikitext
 <h2>unmarked</h2>
 unmarked
 ==1==
 one
 ==2==
 two
 <h2>unmarked</h2>
 unmarked
 ==1==
 one
 ==2==
 two
-!! result
+!! html
 ==2==
 two
 !! end
 ==2==
 two
 !! end
@@ -13613,10 +13861,10 @@ two
 Section extraction, heading surrounded by <noinclude>
 !! options
 section=1
 Section extraction, heading surrounded by <noinclude>
 !! options
 section=1
-!! input
+!! wikitext
 <noinclude>==unmarked==</noinclude>
 ==marked==
 <noinclude>==unmarked==</noinclude>
 ==marked==
-!! result
+!! html
 ==marked==
 !!end
 
 ==marked==
 !!end
 
@@ -13625,13 +13873,13 @@ section=1
 Sectiion with all-equals
 !! options
 section=2
 Sectiion with all-equals
 !! options
 section=2
-!! input
+!! wikitext
 === 
 The line above must have a trailing space
 === <!--
 --> <!-- -->
 But just in case it doesn't...
 === 
 The line above must have a trailing space
 === <!--
 --> <!-- -->
 But just in case it doesn't...
-!! result
+!! html
 === <!--
 --> <!-- -->
 But just in case it doesn't...
 === <!--
 --> <!-- -->
 But just in case it doesn't...
@@ -13641,7 +13889,7 @@ But just in case it doesn't...
 Section replacement test (section 0)
 !! options
 replace=0,"xxx"
 Section replacement test (section 0)
 !! options
 replace=0,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13653,7 +13901,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 xxx
 
 ==a==
 xxx
 
 ==a==
@@ -13672,7 +13920,7 @@ xxx
 Section replacement test (section 1)
 !! options
 replace=1,"xxx"
 Section replacement test (section 1)
 !! options
 replace=1,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13684,7 +13932,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 xxx
 
 start
 xxx
 
@@ -13701,7 +13949,7 @@ xxx
 Section replacement test (section 2)
 !! options
 replace=2,"xxx"
 Section replacement test (section 2)
 !! options
 replace=2,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13713,7 +13961,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 ==a==
 xxx
 start
 ==a==
 xxx
@@ -13731,7 +13979,7 @@ xxx
 Section replacement test (section 3)
 !! options
 replace=3,"xxx"
 Section replacement test (section 3)
 !! options
 replace=3,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13743,7 +13991,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13762,7 +14010,7 @@ xxx
 Section replacement test (section 4)
 !! options
 replace=4,"xxx"
 Section replacement test (section 4)
 !! options
 replace=4,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13774,7 +14022,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13789,7 +14037,7 @@ xxx
 Section replacement test (section 5)
 !! options
 replace=5,"xxx"
 Section replacement test (section 5)
 !! options
 replace=5,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13801,7 +14049,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13820,7 +14068,7 @@ xxx
 Section replacement test (section 6)
 !! options
 replace=6,"xxx"
 Section replacement test (section 6)
 !! options
 replace=6,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13832,7 +14080,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13850,7 +14098,7 @@ xxx
 Section replacement test (section 7)
 !! options
 replace=7,"xxx"
 Section replacement test (section 7)
 !! options
 replace=7,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13862,7 +14110,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13881,7 +14129,7 @@ xxx
 Section replacement test (section 8)
 !! options
 replace=8,"xxx"
 Section replacement test (section 8)
 !! options
 replace=8,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13893,7 +14141,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13912,7 +14160,7 @@ xxx
 Section replacement test (section 9)
 !! options
 replace=9,"xxx"
 Section replacement test (section 9)
 !! options
 replace=9,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13924,7 +14172,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13941,7 +14189,7 @@ xxx
 Section replacement test (section 10)
 !! options
 replace=10,"xxx"
 Section replacement test (section 10)
 !! options
 replace=10,"xxx"
-!! input
+!! wikitext
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13953,7 +14201,7 @@ start
 ===bc===
 ==c==
 ===ca===
 ===bc===
 ==c==
 ===ca===
-!! result
+!! html
 start
 ==a==
 ===aa===
 start
 ==a==
 ===aa===
@@ -13971,11 +14219,11 @@ xxx
 Section replacement test with initial whitespace (bug 13728)
 !! options
 replace=2,"xxx"
 Section replacement test with initial whitespace (bug 13728)
 !! options
 replace=2,"xxx"
-!! input
+!! wikitext
  Preformatted initial line
 ==a==
 ===a===
  Preformatted initial line
 ==a==
 ===a===
-!! result
+!! html
  Preformatted initial line
 ==a==
 xxx
  Preformatted initial line
 ==a==
 xxx
@@ -13986,10 +14234,10 @@ xxx
 Section extraction, heading followed by pre with 20 spaces (bug 6398)
 !! options
 section=1
 Section extraction, heading followed by pre with 20 spaces (bug 6398)
 !! options
 section=1
-!! input
+!! wikitext
 ==a==
                     a
 ==a==
                     a
-!! result
+!! html
 ==a==
                     a
 !! end
 ==a==
                     a
 !! end
@@ -13998,10 +14246,10 @@ section=1
 Section extraction, heading followed by pre with 19 spaces (bug 6398 sanity check)
 !! options
 section=1
 Section extraction, heading followed by pre with 19 spaces (bug 6398 sanity check)
 !! options
 section=1
-!! input
+!! wikitext
 ==a==
                    a
 ==a==
                    a
-!! result
+!! html
 ==a==
                    a
 !! end
 ==a==
                    a
 !! end
@@ -14011,7 +14259,7 @@ section=1
 Section extraction, <pre> around bogus header (bug 10309)
 !! options
 noxml section=2
 Section extraction, <pre> around bogus header (bug 10309)
 !! options
 noxml section=2
-!! input
+!! wikitext
 == Section One ==
 <pre>
 =======
 == Section One ==
 <pre>
 =======
@@ -14019,7 +14267,7 @@ noxml section=2
 
 == Section Two ==
 stuff
 
 == Section Two ==
 stuff
-!! result
+!! html
 == Section Two ==
 stuff
 !! end
 == Section Two ==
 stuff
 !! end
@@ -14028,7 +14276,7 @@ stuff
 Section replacement, <pre> around bogus header (bug 10309)
 !! options
 noxml replace=2,"xxx"
 Section replacement, <pre> around bogus header (bug 10309)
 !! options
 noxml replace=2,"xxx"
-!! input
+!! wikitext
 == Section One ==
 <pre>
 =======
 == Section One ==
 <pre>
 =======
@@ -14036,7 +14284,7 @@ noxml replace=2,"xxx"
 
 == Section Two ==
 stuff
 
 == Section Two ==
 stuff
-!! result
+!! html
 == Section One ==
 <pre>
 =======
 == Section One ==
 <pre>
 =======
@@ -14049,9 +14297,9 @@ xxx
 
 !! test
 Handling of &#x0A; in URLs
 
 !! test
 Handling of &#x0A; in URLs
-!! input
+!! wikitext
 **irc://&#x0A;a
 **irc://&#x0A;a
-!! result
+!! html
 <ul>
 <li><ul>
 <li><a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a>
 <ul>
 <li><ul>
 <li><a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a>
@@ -14062,30 +14310,21 @@ Handling of &#x0A; in URLs
 
 !!end
 
 
 !!end
 
-!! test
-5 quotes, code coverage +1 line (php)
-!! options
-php
-!! input
-'''''
-!! result
-!! end
 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
 !! test
 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
 !! test
-5 quotes, code coverage +1 line (parsoid)
-!! options
-parsoid
-!! input
+5 quotes, code coverage +1 line
+!! wikitext
 '''''
 '''''
-!! result
+!! html/php
+!! html/parsoid
 <p><b><i></i></b></p>
 !! end
 
 !! test
 Special:Search page linking.
 <p><b><i></i></b></p>
 !! end
 
 !! test
 Special:Search page linking.
-!! input
+!! wikitext
 {{Special:search}}
 {{Special:search}}
-!! result
+!! html
 <p><a href="/wiki/Special:Search" title="Special:Search">Special:Search</a>
 </p>
 !! end
 <p><a href="/wiki/Special:Search" title="Special:Search">Special:Search</a>
 </p>
 !! end
@@ -14094,7 +14333,7 @@ Special:Search page linking.
 Say the magic word
 !! options
 title=[[Parser test]]
 Say the magic word
 !! options
 title=[[Parser test]]
-!! input
+!! wikitext
 * {{PAGENAME}}
 * {{PAGENAMEE}}
 * {{FULLPAGENAME}}
 * {{PAGENAME}}
 * {{PAGENAMEE}}
 * {{FULLPAGENAME}}
@@ -14117,7 +14356,7 @@ title=[[Parser test]]
 * {{SUBJECTSPACE}}
 * {{SUBJECTSPACEE}}
 * {{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}}
 * {{SUBJECTSPACE}}
 * {{SUBJECTSPACEE}}
 * {{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}}
-!! result
+!! html
 <ul>
 <li> Parser test
 </li>
 <ul>
 <li> Parser test
 </li>
@@ -14170,7 +14409,7 @@ title=[[Parser test]]
 
 !! test
 Gallery
 
 !! test
 Gallery
-!! input
+!! wikitext
 <gallery>
 image1.png |
 image2.gif|||||
 <gallery>
 image1.png |
 image2.gif|||||
@@ -14181,7 +14420,7 @@ image4    |300px| centre
 [[x|xx]]]]
 * image6
 </gallery>
 [[x|xx]]]]
 * image6
 </gallery>
-!! result
+!! html
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="height: 150px;">Image1.png</div>
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="height: 150px;">Image1.png</div>
@@ -14225,7 +14464,7 @@ image4    |300px| centre
 
 !! test
 Gallery (with options)
 
 !! test
 Gallery (with options)
-!! input
+!! wikitext
 <gallery widths='70px' heights='40px' perrow='2' caption='Foo [[Main Page]]' >
 File:Nonexistant.jpg|caption
 File:Nonexistant.jpg
 <gallery widths='70px' heights='40px' perrow='2' caption='Foo [[Main Page]]' >
 File:Nonexistant.jpg|caption
 File:Nonexistant.jpg
@@ -14233,7 +14472,7 @@ image:foobar.jpg|some '''caption''' [[Main Page]]
 image:foobar.jpg
 image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
 </gallery>
 image:foobar.jpg
 image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
 </gallery>
-!! result
+!! html
 <ul class="gallery mw-gallery-traditional" 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">
 <ul class="gallery mw-gallery-traditional" 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">
@@ -14273,12 +14512,12 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
 
 !! test
 Gallery with wikitext inside caption
 
 !! test
 Gallery with wikitext inside caption
-!! input
+!! wikitext
 <gallery>
 File:foobar.jpg|[[File:foobar.jpg|20px|desc|alt=inneralt]]|alt=galleryalt
 File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt
 </gallery>
 <gallery>
 File:foobar.jpg|[[File:foobar.jpg|20px|desc|alt=inneralt]]|alt=galleryalt
 File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt
 </gallery>
-!! result
+!! html
 <ul class="gallery mw-gallery-traditional">
                <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/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
 <ul class="gallery mw-gallery-traditional">
                <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/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
@@ -14300,14 +14539,14 @@ File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt
 
 !! test
 gallery (with showfilename option)
 
 !! test
 gallery (with showfilename option)
-!! input
+!! wikitext
 <gallery showfilename>
 File:Nonexistant.jpg|caption
 File:Nonexistant.jpg
 image:foobar.jpg|some '''caption''' [[Main Page]]
 File:Foobar.jpg
 </gallery>
 <gallery showfilename>
 File:Nonexistant.jpg|caption
 File:Nonexistant.jpg
 image:foobar.jpg|some '''caption''' [[Main Page]]
 File:Foobar.jpg
 </gallery>
-!! result
+!! html
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="height: 150px;">Nonexistant.jpg</div>
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="height: 150px;">Nonexistant.jpg</div>
@@ -14345,14 +14584,14 @@ some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 
 !! test
 Gallery (with namespace-less filenames)
 
 !! test
 Gallery (with namespace-less filenames)
-!! input
+!! wikitext
 <gallery>
 File:Nonexistant.jpg
 Nonexistant.jpg
 image:foobar.jpg
 foobar.jpg
 </gallery>
 <gallery>
 File:Nonexistant.jpg
 Nonexistant.jpg
 image:foobar.jpg
 foobar.jpg
 </gallery>
-!! result
+!! html
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="height: 150px;">Nonexistant.jpg</div>
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="height: 150px;">Nonexistant.jpg</div>
@@ -14380,163 +14619,172 @@ foobar.jpg
 
 !! test
 HTML Hex character encoding (spells the word "JavaScript")
 
 !! test
 HTML Hex character encoding (spells the word "JavaScript")
-!! input
+!! wikitext
 &#x4A;&#x061;&#x0076;&#x00061;&#x000053;&#x0000063;&#114;&#x0000069;&#00000112;&#x0000000074;
 &#x4A;&#x061;&#x0076;&#x00061;&#x000053;&#x0000063;&#114;&#x0000069;&#00000112;&#x0000000074;
-!! result
+!! html
 <p>&#x4a;&#x61;&#x76;&#x61;&#x53;&#x63;&#114;&#x69;&#112;&#x74;
 </p>
 !! end
 
 !! test
 HTML Hex character encoding bogus encoding (bug 26437 regression check)
 <p>&#x4a;&#x61;&#x76;&#x61;&#x53;&#x63;&#114;&#x69;&#112;&#x74;
 </p>
 !! end
 
 !! test
 HTML Hex character encoding bogus encoding (bug 26437 regression check)
-!! input
+!! wikitext
 &#xsee;&#XSEE;
 &#xsee;&#XSEE;
-!! result
+!! html
 <p>&amp;#xsee;&amp;#XSEE;
 </p>
 !! end
 
 !! test
 HTML Hex character encoding mixed case
 <p>&amp;#xsee;&amp;#XSEE;
 </p>
 !! end
 
 !! test
 HTML Hex character encoding mixed case
-!! input
+!! wikitext
 &#xEE;&#Xee;
 &#xEE;&#Xee;
-!! result
+!! html
 <p>&#xee;&#xee;
 </p>
 !! end
 
 !! test
 __FORCETOC__ override
 <p>&#xee;&#xee;
 </p>
 !! end
 
 !! test
 __FORCETOC__ override
-!! input
+!! wikitext
 __NEWSECTIONLINK__
 __FORCETOC__
 __NEWSECTIONLINK__
 __FORCETOC__
-!! result
+!! html
 <p><br />
 </p>
 !! end
 
 !! test
 ISBN code coverage
 <p><br />
 </p>
 !! end
 
 !! test
 ISBN code coverage
-!! input
+!! wikitext
 ISBN  978-0-1234-56&#x20;789
 ISBN  978-0-1234-56&#x20;789
-!! result
+!! html
 <p><a href="/wiki/Special:BookSources/9780123456" class="internal mw-magiclink-isbn">ISBN 978-0-1234-56</a>&#x20;789
 </p>
 !! end
 
 !! test
 ISBN followed by 5 spaces
 <p><a href="/wiki/Special:BookSources/9780123456" class="internal mw-magiclink-isbn">ISBN 978-0-1234-56</a>&#x20;789
 </p>
 !! end
 
 !! test
 ISBN followed by 5 spaces
-!! input
+!! wikitext
 ISBN    
 ISBN    
-!! result
+!! html
 <p>ISBN    
 </p>
 !! end
 
 !! test
 Double ISBN
 <p>ISBN    
 </p>
 !! end
 
 !! test
 Double ISBN
-!! input
+!! wikitext
 ISBN ISBN 1234567890
 ISBN ISBN 1234567890
-!! result
+!! html
 <p>ISBN <a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>
 </p>
 !! end
 
 <p>ISBN <a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>
 </p>
 !! end
 
+!! test
+ISBN with an X
+!! wikitext
+ISBN 3-462-04561-X
+!! html
+<p><a href="/wiki/Special:BookSources/346204561X" class="internal mw-magiclink-isbn">ISBN 3-462-04561-X</a>
+</p>
+!! end
+
 !! test
 Bug 22905: <abbr> followed by ISBN followed by </a>
 !! test
 Bug 22905: <abbr> followed by ISBN followed by </a>
-!! input
+!! wikitext
 <abbr>(fr)</abbr> ISBN 2753300917 [http://www.example.com example.com]
 <abbr>(fr)</abbr> ISBN 2753300917 [http://www.example.com example.com]
-!! result
+!! html
 <p><abbr>(fr)</abbr> <a href="/wiki/Special:BookSources/2753300917" class="internal mw-magiclink-isbn">ISBN 2753300917</a> <a rel="nofollow" class="external text" href="http://www.example.com">example.com</a>
 </p>
 !! end
 
 !! test
 Double RFC
 <p><abbr>(fr)</abbr> <a href="/wiki/Special:BookSources/2753300917" class="internal mw-magiclink-isbn">ISBN 2753300917</a> <a rel="nofollow" class="external text" href="http://www.example.com">example.com</a>
 </p>
 !! end
 
 !! test
 Double RFC
-!! input
+!! wikitext
 RFC RFC 1234
 RFC RFC 1234
-!! result
+!! html
 <p>RFC <a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc1234">RFC 1234</a>
 </p>
 !! end
 
 !! test
 Double RFC with a wiki link
 <p>RFC <a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc1234">RFC 1234</a>
 </p>
 !! end
 
 !! test
 Double RFC with a wiki link
-!! input
+!! wikitext
 RFC [[RFC 1234]]
 RFC [[RFC 1234]]
-!! result
+!! html
 <p>RFC <a href="/index.php?title=RFC_1234&amp;action=edit&amp;redlink=1" class="new" title="RFC 1234 (page does not exist)">RFC 1234</a>
 </p>
 !! end
 
 !! test
 RFC code coverage
 <p>RFC <a href="/index.php?title=RFC_1234&amp;action=edit&amp;redlink=1" class="new" title="RFC 1234 (page does not exist)">RFC 1234</a>
 </p>
 !! end
 
 !! test
 RFC code coverage
-!! input
+!! wikitext
 RFC   983&#x20;987
 RFC   983&#x20;987
-!! result
+!! html
 <p><a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc983">RFC 983</a>&#x20;987
 </p>
 !! end
 
 !! test
 Centre-aligned image
 <p><a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc983">RFC 983</a>&#x20;987
 </p>
 !! end
 
 !! test
 Centre-aligned image
-!! input
+!! wikitext
 [[Image:foobar.jpg|centre]]
 [[Image:foobar.jpg|centre]]
-!! result
+!! html
 <div class="center"><div class="floatnone"><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></div></div>
 
 !!end
 
 !! test
 None-aligned image
 <div class="center"><div class="floatnone"><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></div></div>
 
 !!end
 
 !! test
 None-aligned image
-!! input
+!! wikitext
 [[Image:foobar.jpg|none]]
 [[Image:foobar.jpg|none]]
-!! result
+!! html
 <div class="floatnone"><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></div>
 
 !!end
 
 !! test
 Width + Height sized image (using px) (height is ignored)
 <div class="floatnone"><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></div>
 
 !!end
 
 !! test
 Width + Height sized image (using px) (height is ignored)
-!! input
+!! wikitext
 [[Image:foobar.jpg|640x480px]]
 [[Image:foobar.jpg|640x480px]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a>
 </p>
 !!end
 
 !! test
 Width-sized image (using px, no following whitespace)
 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a>
 </p>
 !!end
 
 !! test
 Width-sized image (using px, no following whitespace)
-!! input
+!! wikitext
 [[Image:foobar.jpg|640px]]
 [[Image:foobar.jpg|640px]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a>
 </p>
 !!end
 
 !! test
 Width-sized image (using px, with following whitespace - test regression from r39467)
 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a>
 </p>
 !!end
 
 !! test
 Width-sized image (using px, with following whitespace - test regression from r39467)
-!! input
+!! wikitext
 [[Image:foobar.jpg|640px ]]
 [[Image:foobar.jpg|640px ]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a>
 </p>
 !!end
 
 !! test
 Width-sized image (using px, with preceding whitespace - test regression from r39467)
 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a>
 </p>
 !!end
 
 !! test
 Width-sized image (using px, with preceding whitespace - test regression from r39467)
-!! input
+!! wikitext
 [[Image:foobar.jpg| 640px]]
 [[Image:foobar.jpg| 640px]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a>
 </p>
 !!end
 
 !! test
 Another italics / bold test
 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a>
 </p>
 !!end
 
 !! test
 Another italics / bold test
-!! input
+!! wikitext
  ''' ''x'
  ''' ''x'
-!! result
+!! html
 <pre>'<i> </i>x'
 </pre>
 !!end
 <pre>'<i> </i>x'
 </pre>
 !!end
@@ -14548,9 +14796,9 @@ Another italics / bold test
 dt/dd/dl test
 !! options
 disabled
 dt/dd/dl test
 !! options
 disabled
-!! input
+!! wikitext
 :;;;::
 :;;;::
-!! result
+!! html
 <dl>
 <dd><dl>
 <dt><dl>
 <dl>
 <dd><dl>
 <dt><dl>
@@ -14577,18 +14825,18 @@ disabled
 # Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "</a>" tag.
 !! test
 Images with the "|" character in the comment
 # Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "</a>" tag.
 !! test
 Images with the "|" character in the comment
-!! input
+!! wikitext
 [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|&param2=|x external] URL]]
 [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|&param2=|x external] URL]]
-!! result
+!! html
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>An <a rel="nofollow" class="external text" href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx">external</a> URL</div></div></div>
 
 !!end
 
 !! test
 [Before] HTML without raw HTML enabled ($wgRawHtml==false)
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>An <a rel="nofollow" class="external text" href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx">external</a> URL</div></div></div>
 
 !!end
 
 !! test
 [Before] HTML without raw HTML enabled ($wgRawHtml==false)
-!! input
+!! wikitext
 <html><script>alert(1);</script></html>
 <html><script>alert(1);</script></html>
-!! result
+!! html
 <p>&lt;html&gt;&lt;script&gt;alert(1);&lt;/script&gt;&lt;/html&gt;
 </p>
 !! end
 <p>&lt;html&gt;&lt;script&gt;alert(1);&lt;/script&gt;&lt;/html&gt;
 </p>
 !! end
@@ -14597,9 +14845,9 @@ Images with the "|" character in the comment
 HTML with raw HTML ($wgRawHtml==true)
 !! options
 wgRawHtml=1
 HTML with raw HTML ($wgRawHtml==true)
 !! options
 wgRawHtml=1
-!! input
+!! wikitext
 <html><script>alert(1);</script></html>
 <html><script>alert(1);</script></html>
-!! result
+!! html
 <p><script>alert(1);</script>
 </p>
 !! end
 <p><script>alert(1);</script>
 </p>
 !! end
@@ -14608,9 +14856,9 @@ wgRawHtml=1
 Parents of subpages, one level up
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
 Parents of subpages, one level up
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
-!! input
+!! wikitext
 [[../|L2]]
 [[../|L2]]
-!! result
+!! html
 <p><a href="/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">L2</a>
 </p>
 !! end
 <p><a href="/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">L2</a>
 </p>
 !! end
@@ -14620,9 +14868,9 @@ subpage title=[[Subpage test/L1/L2/L3]]
 Parents of subpages, one level up, not named
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
 Parents of subpages, one level up, not named
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
-!! input
+!! wikitext
 [[../]]
 [[../]]
-!! result
+!! html
 <p><a href="/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">Subpage test/L1/L2</a>
 </p>
 !! end
 <p><a href="/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">Subpage test/L1/L2</a>
 </p>
 !! end
@@ -14633,11 +14881,11 @@ subpage title=[[Subpage test/L1/L2/L3]]
 Parents of subpages, two levels up
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
 Parents of subpages, two levels up
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
-!! input
+!! wikitext
 [[../../|L1]]2
 
 [[../../|L1]]l
 [[../../|L1]]2
 
 [[../../|L1]]l
-!! result
+!! html
 <p><a href="/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1</a>2
 </p><p><a href="/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1l</a>
 </p>
 <p><a href="/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1</a>2
 </p><p><a href="/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1l</a>
 </p>
@@ -14647,9 +14895,9 @@ subpage title=[[Subpage test/L1/L2/L3]]
 Parents of subpages, two levels up, without trailing slash or name.
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
 Parents of subpages, two levels up, without trailing slash or name.
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
-!! input
+!! wikitext
 [[../..]]
 [[../..]]
-!! result
+!! html
 <p>[[../..]]
 </p>
 !! end
 <p>[[../..]]
 </p>
 !! end
@@ -14658,9 +14906,9 @@ subpage title=[[Subpage test/L1/L2/L3]]
 Parents of subpages, two levels up, with lots of extra trailing slashes.
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
 Parents of subpages, two levels up, with lots of extra trailing slashes.
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
-!! input
+!! wikitext
 [[../../////]]
 [[../../////]]
-!! result
+!! html
 <p><a href="/index.php?title=Subpage_test/L1////&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1//// (page does not exist)">///</a>
 </p>
 !! end
 <p><a href="/index.php?title=Subpage_test/L1////&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1//// (page does not exist)">///</a>
 </p>
 !! end
@@ -14675,9 +14923,9 @@ Sibling article
 Transclusion of a sibling page (one level up)
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
 Transclusion of a sibling page (one level up)
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
-!! input
+!! wikitext
 {{../L3Sibling}}
 {{../L3Sibling}}
-!! result
+!! html
 <p>Sibling article
 </p>
 !! end
 <p>Sibling article
 </p>
 !! end
@@ -14686,9 +14934,9 @@ subpage title=[[Subpage test/L1/L2/L3]]
 Transclusion of a child page
 !! options
 subpage title=[[Subpage test/L1/L2]]
 Transclusion of a child page
 !! options
 subpage title=[[Subpage test/L1/L2]]
-!! input
+!! wikitext
 {{/L3Sibling}}
 {{/L3Sibling}}
-!! result
+!! html
 <p>Sibling article
 </p>
 !! end
 <p>Sibling article
 </p>
 !! end
@@ -14697,20 +14945,20 @@ subpage title=[[Subpage test/L1/L2]]
 Non-transclusion because of too many up levels
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
 Non-transclusion because of too many up levels
 !! options
 subpage title=[[Subpage test/L1/L2/L3]]
-!! input
+!! wikitext
 {{../../../../More than parent}}
 {{../../../../More than parent}}
-!! result
+!! html
 <p>{{../../../../More than parent}}
 </p>
 !! end
 
 !! test
 Definition list code coverage
 <p>{{../../../../More than parent}}
 </p>
 !! end
 
 !! test
 Definition list code coverage
-!! input
+!! wikitext
 ; title   : def
 ; title : def
 ;title: def
 ; title   : def
 ; title : def
 ;title: def
-!! result
+!! html
 <dl>
 <dt> title  &#160;</dt>
 <dd> def
 <dl>
 <dt> title  &#160;</dt>
 <dd> def
@@ -14727,27 +14975,27 @@ Definition list code coverage
 
 !! test
 Don't fall for the self-closing div
 
 !! test
 Don't fall for the self-closing div
-!! input
+!! wikitext
 <div>hello world</div/>
 <div>hello world</div/>
-!! result
+!! html
 <div>hello world</div>
 
 !! end
 
 !! test
 MSGNW magic word
 <div>hello world</div>
 
 !! end
 
 !! test
 MSGNW magic word
-!! input
+!! wikitext
 {{MSGNW:msg}}
 {{MSGNW:msg}}
-!! result
+!! html
 <p>&#91;&#91;:Template:Msg&#93;&#93;
 </p>
 !! end
 
 !! test
 RAW magic word
 <p>&#91;&#91;:Template:Msg&#93;&#93;
 </p>
 !! end
 
 !! test
 RAW magic word
-!! input
+!! wikitext
 {{RAW:QUERTY}}
 {{RAW:QUERTY}}
-!! result
+!! html
 <p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
 </p>
 !! end
 <p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
 </p>
 !! end
@@ -14755,19 +15003,19 @@ RAW magic word
 # This isn't needed for XHTML conformance, but would be handy as a fallback security measure
 !! test
 Always escape literal '>' in output, not just after '<'
 # This isn't needed for XHTML conformance, but would be handy as a fallback security measure
 !! test
 Always escape literal '>' in output, not just after '<'
-!! input
+!! wikitext
 ><>
 ><>
-!! result
+!! html
 <p>&gt;&lt;&gt;
 </p>
 !! end
 
 !! test
 Template caching
 <p>&gt;&lt;&gt;
 </p>
 !! end
 
 !! test
 Template caching
-!! input
+!! wikitext
 {{Test}}
 {{Test}}
 {{Test}}
 {{Test}}
-!! result
+!! html
 <p>This is a test template
 This is a test template
 </p>
 <p>This is a test template
 This is a test template
 </p>
@@ -14782,9 +15030,9 @@ MediaWiki:Fake
 
 !! test
 Inclusion of !userCanEdit() content
 
 !! test
 Inclusion of !userCanEdit() content
-!! input
+!! wikitext
 {{MediaWiki:Fake}}
 {{MediaWiki:Fake}}
-!! result
+!! html
 <h2><span class="mw-headline" id="header">header</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=MediaWiki:Fake&amp;action=edit&amp;section=T-1" title="MediaWiki:Fake">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
 <h2><span class="mw-headline" id="header">header</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=MediaWiki:Fake&amp;action=edit&amp;section=T-1" title="MediaWiki:Fake">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
@@ -14792,14 +15040,14 @@ Inclusion of !userCanEdit() content
 
 !! test
 Out-of-order TOC heading levels
 
 !! test
 Out-of-order TOC heading levels
-!! input
+!! wikitext
 ==2==
 ======6======
 ===3===
 =1=
 =====5=====
 ==2==
 ==2==
 ======6======
 ===3===
 =1=
 =====5=====
 ==2==
-!! result
+!! html
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#2"><span class="tocnumber">1</span> <span class="toctext">2</span></a>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#2"><span class="tocnumber">1</span> <span class="toctext">2</span></a>
@@ -14829,9 +15077,9 @@ Out-of-order TOC heading levels
 
 !! test
 ISBN with a dummy number
 
 !! test
 ISBN with a dummy number
-!! input
+!! wikitext
 ISBN ---
 ISBN ---
-!! result
+!! html
 <p>ISBN ---
 </p>
 !! end
 <p>ISBN ---
 </p>
 !! end
@@ -14839,9 +15087,9 @@ ISBN ---
 
 !! test
 ISBN with space-delimited number
 
 !! test
 ISBN with space-delimited number
-!! input
+!! wikitext
 ISBN 92 9017 032 8
 ISBN 92 9017 032 8
-!! result
+!! html
 <p><a href="/wiki/Special:BookSources/9290170328" class="internal mw-magiclink-isbn">ISBN 92 9017 032 8</a>
 </p>
 !! end
 <p><a href="/wiki/Special:BookSources/9290170328" class="internal mw-magiclink-isbn">ISBN 92 9017 032 8</a>
 </p>
 !! end
@@ -14849,9 +15097,9 @@ ISBN 92 9017 032 8
 
 !! test
 ISBN with multiple spaces, no number
 
 !! test
 ISBN with multiple spaces, no number
-!! input
+!! wikitext
 ISBN  foo
 ISBN  foo
-!! result
+!! html
 <p>ISBN  foo
 </p>
 !! end
 <p>ISBN  foo
 </p>
 !! end
@@ -14859,13 +15107,13 @@ ISBN  foo
 
 !! test
 ISBN length
 
 !! test
 ISBN length
-!! input
+!! wikitext
 ISBN 123456789
 
 ISBN 1234567890
 
 ISBN 12345678901
 ISBN 123456789
 
 ISBN 1234567890
 
 ISBN 12345678901
-!! result
+!! html
 <p>ISBN 123456789
 </p><p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>
 </p><p>ISBN 12345678901
 <p>ISBN 123456789
 </p><p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>
 </p><p>ISBN 12345678901
@@ -14875,11 +15123,11 @@ ISBN 12345678901
 
 !! test
 ISBN with trailing year (bug 8110)
 
 !! test
 ISBN with trailing year (bug 8110)
-!! input
+!! wikitext
 ISBN 1-234-56789-0 - 2006
 
 ISBN 1 234 56789 0 - 2006
 ISBN 1-234-56789-0 - 2006
 
 ISBN 1 234 56789 0 - 2006
-!! result
+!! html
 <p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1-234-56789-0</a> - 2006
 </p><p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1 234 56789 0</a> - 2006
 </p>
 <p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1-234-56789-0</a> - 2006
 </p><p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1 234 56789 0</a> - 2006
 </p>
@@ -14888,47 +15136,47 @@ ISBN 1 234 56789 0 - 2006
 
 !! test
 anchorencode
 
 !! test
 anchorencode
-!! input
+!! wikitext
 {{anchorencode:foo bar©#%n}}
 {{anchorencode:foo bar©#%n}}
-!! result
+!! html
 <p>foo_bar.C2.A9.23.25n
 </p>
 !! end
 
 !! test
 anchorencode trims spaces
 <p>foo_bar.C2.A9.23.25n
 </p>
 !! end
 
 !! test
 anchorencode trims spaces
-!! input
+!! wikitext
 {{anchorencode: __pretty__please__}}
 {{anchorencode: __pretty__please__}}
-!! result
+!! html
 <p>pretty_please
 </p>
 !! end
 
 !! test
 anchorencode deals with links
 <p>pretty_please
 </p>
 !! end
 
 !! test
 anchorencode deals with links
-!! input
+!! wikitext
 {{anchorencode: [[hello|world]] [[hi]]}}
 {{anchorencode: [[hello|world]] [[hi]]}}
-!! result
+!! html
 <p>world_hi
 </p>
 !! end
 
 !! test
 anchorencode deals with templates
 <p>world_hi
 </p>
 !! end
 
 !! test
 anchorencode deals with templates
-!! input
+!! wikitext
 {{anchorencode: {{Foo}} }}
 {{anchorencode: {{Foo}} }}
-!! result
+!! html
 <p>FOO
 </p>
 !! end
 
 !! test
 anchorencode encodes like the TOC generator: (bug 18431)
 <p>FOO
 </p>
 !! end
 
 !! test
 anchorencode encodes like the TOC generator: (bug 18431)
-!! input
+!! wikitext
 === _ +:.3A%3A&&amp;]] ===
 {{anchorencode: _ +:.3A%3A&&amp;]] }}
 __NOEDITSECTION__
 === _ +:.3A%3A&&amp;]] ===
 {{anchorencode: _ +:.3A%3A&&amp;]] }}
 __NOEDITSECTION__
-!! result
+!! html
 <h3><span class="mw-headline" id=".2B:.3A.253A.26.26.5D.5D">_ +:.3A%3A&amp;&amp;]]</span></h3>
 <p>.2B:.3A.253A.26.26.5D.5D
 </p>
 <h3><span class="mw-headline" id=".2B:.3A.253A.26.26.5D.5D">_ +:.3A%3A&amp;&amp;]]</span></h3>
 <p>.2B:.3A.253A.26.26.5D.5D
 </p>
@@ -14936,7 +15184,7 @@ __NOEDITSECTION__
 
 !! test
 Bug 6200: blockquotes and paragraph formatting
 
 !! test
 Bug 6200: blockquotes and paragraph formatting
-!! input
+!! wikitext
 <blockquote>
 foo
 </blockquote>
 <blockquote>
 foo
 </blockquote>
@@ -14944,7 +15192,7 @@ foo
 bar
 
  baz
 bar
 
  baz
-!! result
+!! html
 <blockquote>
 <p>foo
 </p>
 <blockquote>
 <p>foo
 </p>
@@ -14957,7 +15205,7 @@ bar
 
 !! test
 Bug 8293: Use of center tag ruins paragraph formatting
 
 !! test
 Bug 8293: Use of center tag ruins paragraph formatting
-!! input
+!! wikitext
 <center>
 foo
 </center>
 <center>
 foo
 </center>
@@ -14965,7 +15213,7 @@ foo
 bar
 
  baz
 bar
 
  baz
-!! result
+!! html
 <center>
 <p>foo
 </p>
 <center>
 <p>foo
 </p>
@@ -14977,24 +15225,14 @@ bar
 !! end
 
 !!test
 !! end
 
 !!test
-Parsing of overlapping (improperly nested) inline html tags (PHP parser)
-!!options
-php
-!!input
+Parsing of overlapping (improperly nested) inline html tags
+!! wikitext
 <span><s>x</span></s>
 <span><s>x</span></s>
-!!result
+!! html/php
 <p><span><s>x&lt;/span&gt;</s></span>
 </p>
 <p><span><s>x&lt;/span&gt;</s></span>
 </p>
-!!end
-
-!!test
-Parsing of overlapping (improperly nested) inline html tags (Parsoid)
-!!options
-parsoid
-!!input
-<span><s>x</span></s>
-!!result
-<p><span><s>x</s></span><s></s>
+!! html/parsoid
+<p><span><s>x</s></span>
 </p>
 !!end
 
 </p>
 !!end
 
@@ -15005,9 +15243,9 @@ parsoid
 Self-link in language variants
 !! options
 title=[[Dunav]] language=sr
 Self-link in language variants
 !! options
 title=[[Dunav]] language=sr
-!! input
+!! wikitext
 Both [[Dunav]] and [[Дунав]] are names for this river.
 Both [[Dunav]] and [[Дунав]] are names for this river.
-!! result
+!! html
 <p>Both <strong class="selflink">Dunav</strong> and <strong class="selflink">Дунав</strong> are names for this river.
 </p>
 !!end
 <p>Both <strong class="selflink">Dunav</strong> and <strong class="selflink">Дунав</strong> are names for this river.
 </p>
 !!end
@@ -15022,9 +15260,9 @@ content
 Link to another existing title shouldn't be parsed as self-link even if it's a variant of this title
 !! options
 title=[[Duna]] language=sr
 Link to another existing title shouldn't be parsed as self-link even if it's a variant of this title
 !! options
 title=[[Duna]] language=sr
-!! input
+!! wikitext
 [[Дуна]] is not a self-link while [[Duna]] and [[Dуна]] are still self-links.
 [[Дуна]] is not a self-link while [[Duna]] and [[Dуна]] are still self-links.
-!! result
+!! html
 <p><a href="/wiki/%D0%94%D1%83%D0%BD%D0%B0" title="Дуна">Дуна</a> is not a self-link while <strong class="selflink">Duna</strong> and <strong class="selflink">Dуна</strong> are still self-links.
 </p>
 !! end
 <p><a href="/wiki/%D0%94%D1%83%D0%BD%D0%B0" title="Дуна">Дуна</a> is not a self-link while <strong class="selflink">Duna</strong> and <strong class="selflink">Dуна</strong> are still self-links.
 </p>
 !! end
@@ -15033,9 +15271,9 @@ title=[[Duna]] language=sr
 Link to a section of a variant of this title shouldn't be parsed as self-link
 !! options
 title=[[Duna]] language=sr
 Link to a section of a variant of this title shouldn't be parsed as self-link
 !! options
 title=[[Duna]] language=sr
-!! input
+!! wikitext
 [[Dуна]] is a self-link while [[Dunа#Foo]] and [[Dуна#Foo]] are not self-links.
 [[Dуна]] is a self-link while [[Dunа#Foo]] and [[Dуна#Foo]] are not self-links.
-!! result
+!! html
 <p><strong class="selflink">Dуна</strong> is a self-link while <a href="/wiki/%D0%94%D1%83%D0%BD%D0%B0" title="Дуна">Dunа#Foo</a> and <a href="/wiki/%D0%94%D1%83%D0%BD%D0%B0" title="Дуна">Dуна#Foo</a> are not self-links.
 </p>
 !! end
 <p><strong class="selflink">Dуна</strong> is a self-link while <a href="/wiki/%D0%94%D1%83%D0%BD%D0%B0" title="Дуна">Dunа#Foo</a> and <a href="/wiki/%D0%94%D1%83%D0%BD%D0%B0" title="Дуна">Dуна#Foo</a> are not self-links.
 </p>
 !! end
@@ -15044,9 +15282,9 @@ title=[[Duna]] language=sr
 Link to pages in language variants
 !! options
 language=sr
 Link to pages in language variants
 !! options
 language=sr
-!! input
+!! wikitext
 Main Page can be written as [[Маин Паге]]
 Main Page can be written as [[Маин Паге]]
-!! result
+!! html
 <p>Main Page can be written as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a>
 </p>
 !!end
 <p>Main Page can be written as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a>
 </p>
 !!end
@@ -15056,9 +15294,9 @@ Main Page can be written as [[Маин Паге]]
 Multiple links to pages in language variants
 !! options
 language=sr
 Multiple links to pages in language variants
 !! options
 language=sr
-!! input
+!! wikitext
 [[Main Page]] can be written as [[Маин Паге]] same as [[Маин Паге]].
 [[Main Page]] can be written as [[Маин Паге]] same as [[Маин Паге]].
-!! result
+!! html
 <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
 <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
@@ -15068,9 +15306,9 @@ language=sr
 Simple template in language variants
 !! options
 language=sr
 Simple template in language variants
 !! options
 language=sr
-!! input
+!! wikitext
 {{тест}}
 {{тест}}
-!! result
+!! html
 <p>This is a test template
 </p>
 !! end
 <p>This is a test template
 </p>
 !! end
@@ -15080,9 +15318,9 @@ language=sr
 Template with explicit namespace in language variants
 !! options
 language=sr
 Template with explicit namespace in language variants
 !! options
 language=sr
-!! input
+!! wikitext
 {{Template:тест}}
 {{Template:тест}}
-!! result
+!! html
 <p>This is a test template
 </p>
 !! end
 <p>This is a test template
 </p>
 !! end
@@ -15092,9 +15330,9 @@ language=sr
 Basic test for template parameter in language variants
 !! options
 language=sr
 Basic test for template parameter in language variants
 !! options
 language=sr
-!! input
+!! wikitext
 {{парамтест|param=foo}}
 {{парамтест|param=foo}}
-!! result
+!! html
 <p>This is a test template with parameter foo
 </p>
 !! end
 <p>This is a test template with parameter foo
 </p>
 !! end
@@ -15104,9 +15342,9 @@ language=sr
 Simple category in language variants
 !! options
 language=sr cat
 Simple category in language variants
 !! options
 language=sr cat
-!! input
+!! wikitext
 [[Category:МедиаWики Усер'с Гуиде]]
 [[Category:МедиаWики Усер'с Гуиде]]
-!! result
+!! html
 <a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:MediaWiki_User%27s_Guide" title="Категорија:MediaWiki User's Guide">MediaWiki User's Guide</a>
 !! end
 
 <a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:MediaWiki_User%27s_Guide" title="Категорија:MediaWiki User's Guide">MediaWiki User's Guide</a>
 !! end
 
@@ -15127,9 +15365,9 @@ blah
 Don't convert blue categorylinks to another variant (bug 33210)
 !! options
 language=zh cat
 Don't convert blue categorylinks to another variant (bug 33210)
 !! options
 language=zh cat
-!! input
+!! wikitext
 [[A]][[Category:分类]]
 [[A]][[Category:分类]]
-!! result
+!! html
 <a href="/wiki/Category:%E5%88%86%E7%B1%BB" title="Category:分类">分类</a>
 !! end
 
 <a href="/wiki/Category:%E5%88%86%E7%B1%BB" title="Category:分类">分类</a>
 !! end
 
@@ -15138,9 +15376,9 @@ language=zh cat
 Stripping -{}- tags (language variants)
 !! options
 language=sr
 Stripping -{}- tags (language variants)
 !! options
 language=sr
-!! input
+!! wikitext
 Latin proverb: -{Ne nuntium necare}-
 Latin proverb: -{Ne nuntium necare}-
-!! result
+!! html
 <p>Latin proverb: Ne nuntium necare
 </p>
 !! end
 <p>Latin proverb: Ne nuntium necare
 </p>
 !! end
@@ -15150,9 +15388,9 @@ Latin proverb: -{Ne nuntium necare}-
 Prevent conversion with -{}- tags (language variants)
 !! options
 language=sr variant=sr-ec
 Prevent conversion with -{}- tags (language variants)
 !! options
 language=sr variant=sr-ec
-!! input
+!! wikitext
 Latinski: -{Ne nuntium necare}-
 Latinski: -{Ne nuntium necare}-
-!! result
+!! html
 <p>Латински: Ne nuntium necare
 </p>
 !! end
 <p>Латински: Ne nuntium necare
 </p>
 !! end
@@ -15162,9 +15400,9 @@ Latinski: -{Ne nuntium necare}-
 Prevent conversion of text with -{}- tags (language variants)
 !! options
 language=sr variant=sr-ec
 Prevent conversion of text with -{}- tags (language variants)
 !! options
 language=sr variant=sr-ec
-!! input
+!! wikitext
 Latinski: -{Ne nuntium necare}-
 Latinski: -{Ne nuntium necare}-
-!! result
+!! html
 <p>Латински: Ne nuntium necare
 </p>
 !! end
 <p>Латински: Ne nuntium necare
 </p>
 !! end
@@ -15174,9 +15412,9 @@ Latinski: -{Ne nuntium necare}-
 Prevent conversion of links with -{}- tags (language variants)
 !! options
 language=sr variant=sr-ec
 Prevent conversion of links with -{}- tags (language variants)
 !! options
 language=sr variant=sr-ec
-!! input
+!! wikitext
 -{[[Main Page]]}-
 -{[[Main Page]]}-
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 </p>
 !! end
 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 </p>
 !! end
@@ -15186,9 +15424,9 @@ language=sr variant=sr-ec
 -{}- tags within headlines (within html for parserConvert())
 !! options
 language=sr variant=sr-ec
 -{}- tags within headlines (within html for parserConvert())
 !! options
 language=sr variant=sr-ec
-!! input
+!! wikitext
 == -{Naslov}- ==
 == -{Naslov}- ==
-!! result
+!! html
 <h2><span class="mw-headline" id="-.7BNaslov.7D-">Naslov</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Уредите одељак „Naslov“">уреди</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
 <h2><span class="mw-headline" id="-.7BNaslov.7D-">Naslov</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Уредите одељак „Naslov“">уреди</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
@@ -15198,9 +15436,9 @@ language=sr variant=sr-ec
 Explicit definition of language variant alternatives
 !! options
 language=zh variant=zh-tw
 Explicit definition of language variant alternatives
 !! options
 language=zh variant=zh-tw
-!! input
+!! wikitext
 -{zh:China;zh-tw:Taiwan}-, not China
 -{zh:China;zh-tw:Taiwan}-, not China
-!! result
+!! html
 <p>Taiwan, not China
 </p>
 !! end
 <p>Taiwan, not China
 </p>
 !! end
@@ -15210,10 +15448,10 @@ language=zh variant=zh-tw
 Conversion around HTML tags
 !! options
 language=sr variant=sr-ec
 Conversion around HTML tags
 !! options
 language=sr variant=sr-ec
-!! input
+!! wikitext
 -{H|span=>sr-ec:script;title=>sr-ec:src;}-
 <span title="La-{sr-el:L;sr-ec:C;}-tin">ski</span>
 -{H|span=>sr-ec:script;title=>sr-ec:src;}-
 <span title="La-{sr-el:L;sr-ec:C;}-tin">ski</span>
-!! result
+!! html
 <p>
 <span title="ЛаCтин">ски</span>
 </p>
 <p>
 <span title="ЛаCтин">ски</span>
 </p>
@@ -15224,12 +15462,12 @@ language=sr variant=sr-ec
 Explicit session-wise language variant mapping (A flag and - flag)
 !! options
 language=zh variant=zh-tw
 Explicit session-wise language variant mapping (A flag and - flag)
 !! options
 language=zh variant=zh-tw
-!! input
+!! wikitext
 Taiwan is not China.
 But -{A|zh:China;zh-tw:Taiwan}- is China,
 (This-{-|zh:China;zh-tw:Taiwan}- should be stripped!)
 and -{China}- is China.
 Taiwan is not China.
 But -{A|zh:China;zh-tw:Taiwan}- is China,
 (This-{-|zh:China;zh-tw:Taiwan}- should be stripped!)
 and -{China}- is China.
-!! result
+!! html
 <p>Taiwan is not China.
 But Taiwan is Taiwan,
 (This should be stripped!)
 <p>Taiwan is not China.
 But Taiwan is Taiwan,
 (This should be stripped!)
@@ -15241,10 +15479,10 @@ and China is China.
 Explicit session-wise language variant mapping (H flag for hide)
 !! options
 language=zh variant=zh-tw
 Explicit session-wise language variant mapping (H flag for hide)
 !! options
 language=zh variant=zh-tw
-!! input
+!! wikitext
 (This-{H|zh:China;zh-tw:Taiwan}- should be stripped!)
 Taiwan is China.
 (This-{H|zh:China;zh-tw:Taiwan}- should be stripped!)
 Taiwan is China.
-!! result
+!! html
 <p>(This should be stripped!)
 Taiwan is Taiwan.
 </p>
 <p>(This should be stripped!)
 Taiwan is Taiwan.
 </p>
@@ -15254,9 +15492,9 @@ Taiwan is Taiwan.
 Adding explicit conversion rule for title (T flag)
 !! options
 language=zh variant=zh-tw showtitle
 Adding explicit conversion rule for title (T flag)
 !! options
 language=zh variant=zh-tw showtitle
-!! input
+!! wikitext
 Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
 Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
-!! result
+!! html
 Taiwan
 <p>Should be stripped!
 </p>
 Taiwan
 <p>Should be stripped!
 </p>
@@ -15266,9 +15504,9 @@ Taiwan
 Testing that changing the language variant here in the tests actually works
 !! options
 language=zh variant=zh showtitle
 Testing that changing the language variant here in the tests actually works
 !! options
 language=zh variant=zh showtitle
-!! input
+!! wikitext
 Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
 Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
-!! result
+!! html
 China
 <p>Should be stripped!
 </p>
 China
 <p>Should be stripped!
 </p>
@@ -15278,10 +15516,10 @@ China
 Recursive conversion of alt and title attrs shouldn't clear converter state
 !! options
 language=zh variant=zh-cn showtitle
 Recursive conversion of alt and title attrs shouldn't clear converter state
 !! options
 language=zh variant=zh-cn showtitle
-!! input
+!! wikitext
 -{H|zh-cn:Exclamation;zh-tw:exclamation;}-
 Should be stripped-{T|zh-cn:China;zh-tw:Taiwan}-<span title="exclamation">!</span>
 -{H|zh-cn:Exclamation;zh-tw:exclamation;}-
 Should be stripped-{T|zh-cn:China;zh-tw:Taiwan}-<span title="exclamation">!</span>
-!! result
+!! html
 China
 <p>
 Should be stripped<span title="Exclamation">!</span>
 China
 <p>
 Should be stripped<span title="Exclamation">!</span>
@@ -15292,10 +15530,10 @@ Should be stripped<span title="Exclamation">!</span>
 Bug 24072: more test on conversion rule for title
 !! options
 language=zh variant=zh-tw showtitle
 Bug 24072: more test on conversion rule for title
 !! options
 language=zh variant=zh-tw showtitle
-!! input
+!! wikitext
 This should be stripped-{T|zh:China;zh-tw:Taiwan}-!
 This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-.
 This should be stripped-{T|zh:China;zh-tw:Taiwan}-!
 This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-.
-!! result
+!! html
 Taiwan
 <p>This should be stripped!
 This won't take interferes with the title rule.
 Taiwan
 <p>This should be stripped!
 This won't take interferes with the title rule.
@@ -15306,9 +15544,9 @@ This won't take interferes with the title rule.
 Partly disable title conversion if variant == main language code
 !! options
 language=zh variant=zh title=[[ZH]] showtitle
 Partly disable title conversion if variant == main language code
 !! options
 language=zh variant=zh title=[[ZH]] showtitle
-!! input
+!! wikitext
 -{T|zh-cn:CN;zh-tw:TW}-
 -{T|zh-cn:CN;zh-tw:TW}-
-!! result
+!! html
 ZH
 <p>
 </p>
 ZH
 <p>
 </p>
@@ -15318,9 +15556,9 @@ ZH
 Partly disable title conversion if variant == main language code, more
 !! options
 language=zh variant=zh title=[[ZH]] showtitle
 Partly disable title conversion if variant == main language code, more
 !! options
 language=zh variant=zh title=[[ZH]] showtitle
-!! input
+!! wikitext
 -{T|TW}-
 -{T|TW}-
-!! result
+!! html
 ZH
 <p>
 </p>
 ZH
 <p>
 </p>
@@ -15330,9 +15568,9 @@ ZH
 Raw output of variant escape tags (R flag)
 !! options
 language=zh variant=zh-tw
 Raw output of variant escape tags (R flag)
 !! options
 language=zh variant=zh-tw
-!! input
+!! wikitext
 Raw: -{R|zh:China;zh-tw:Taiwan}-
 Raw: -{R|zh:China;zh-tw:Taiwan}-
-!! result
+!! html
 <p>Raw: zh:China;zh-tw:Taiwan
 </p>
 !! end
 <p>Raw: zh:China;zh-tw:Taiwan
 </p>
 !! end
@@ -15341,9 +15579,9 @@ Raw: -{R|zh:China;zh-tw:Taiwan}-
 Nested using of manual convert syntax
 !! options
 language=zh variant=zh-hk
 Nested using of manual convert syntax
 !! options
 language=zh variant=zh-hk
-!! input
+!! wikitext
 Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiwan;zh-hk:H-{ong}- K-{}-ong;}-;}-!
 Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiwan;zh-hk:H-{ong}- K-{}-ong;}-;}-!
-!! result
+!! html
 <p>Nested: Hello Hong Kong!
 </p>
 !! end
 <p>Nested: Hello Hong Kong!
 </p>
 !! end
@@ -15352,7 +15590,7 @@ Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiw
 Proper conversion of text in external links
 !! options
 language=sr variant=sr-ec
 Proper conversion of text in external links
 !! options
 language=sr variant=sr-ec
-!! input
+!! wikitext
 http://www.google.com
 gopher://www.google.com
 [http://www.google.com http://www.google.com]
 http://www.google.com
 gopher://www.google.com
 [http://www.google.com http://www.google.com]
@@ -15360,7 +15598,7 @@ gopher://www.google.com
 [https://www.google.com irc://www.google.com]
 [ftp://www.google.com www.google.com/ftp://dir]
 [//www.google.com www.google.com]
 [https://www.google.com irc://www.google.com]
 [ftp://www.google.com www.google.com/ftp://dir]
 [//www.google.com www.google.com]
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://www.google.com">http://www.google.com</a>
 <a rel="nofollow" class="external free" href="gopher://www.google.com">gopher://www.google.com</a>
 <a rel="nofollow" class="external free" href="http://www.google.com">http://www.google.com</a>
 <p><a rel="nofollow" class="external free" href="http://www.google.com">http://www.google.com</a>
 <a rel="nofollow" class="external free" href="gopher://www.google.com">gopher://www.google.com</a>
 <a rel="nofollow" class="external free" href="http://www.google.com">http://www.google.com</a>
@@ -15375,9 +15613,9 @@ gopher://www.google.com
 Do not convert roman numbers to language variants
 !! options
 language=sr variant=sr-ec
 Do not convert roman numbers to language variants
 !! options
 language=sr variant=sr-ec
-!! input
+!! wikitext
 Fridrih IV je car.
 Fridrih IV je car.
-!! result
+!! html
 <p>Фридрих IV је цар.
 </p>
 !! end
 <p>Фридрих IV је цар.
 </p>
 !! end
@@ -15386,9 +15624,9 @@ Fridrih IV je car.
 Unclosed language converter markup "-{"
 !! options
 language=sr
 Unclosed language converter markup "-{"
 !! options
 language=sr
-!! input
+!! wikitext
 -{T|hello
 -{T|hello
-!! result
+!! html
 <p>-{T|hello
 </p>
 !! end
 <p>-{T|hello
 </p>
 !! end
@@ -15397,9 +15635,9 @@ language=sr
 Don't convert raw rule "-{R|=&gt;}-" to "=>"
 !! options
 language=sr
 Don't convert raw rule "-{R|=&gt;}-" to "=>"
 !! options
 language=sr
-!! input
+!! wikitext
 -{R|=&gt;}-
 -{R|=&gt;}-
-!! result
+!! html
 <p>=&gt;
 </p>
 !!end
 <p>=&gt;
 </p>
 !!end
@@ -15408,9 +15646,9 @@ language=sr
 Don't break link parsing if language converter markup is in the caption.
 !! options
 language=sr variant=sr-ec
 Don't break link parsing if language converter markup is in the caption.
 !! options
 language=sr variant=sr-ec
-!! input
+!! wikitext
 [[Main Page|-{R|main page}-]]
 [[Main Page|-{R|main page}-]]
-!! result
+!! html
 <p><a href="/wiki/Main_Page" title="Маин Паге">main page</a>
 </p>
 !! end
 <p><a href="/wiki/Main_Page" title="Маин Паге">main page</a>
 </p>
 !! end
@@ -15421,9 +15659,9 @@ Don't break image parsing if language converter markup is in the caption.
 !! options
 language=sr
 disabled
 !! options
 language=sr
 disabled
-!! input
+!! wikitext
 [[File:Foobar.jpg|-{R|caption}-]]
 [[File:Foobar.jpg|-{R|caption}-]]
-!! result
+!! html
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! end
@@ -15434,9 +15672,9 @@ Don't break list handling if language converter markup is in the item.
 !! options
 language=zh variant=zh-cn
 disabled
 !! options
 language=zh variant=zh-cn
 disabled
-!! input
+!! wikitext
 ;-{zh-cn:AAA;zh-tw:BBB}-
 ;-{zh-cn:AAA;zh-tw:BBB}-
-!! result
+!! html
 <dl><dt>AAA
 </dt></dl>
 
 <dl><dt>AAA
 </dt></dl>
 
@@ -15448,12 +15686,12 @@ Don't break table handling if language converter markup is in the cell.
 !! options
 language=sr variant=sr-ec
 disabled
 !! options
 language=sr variant=sr-ec
 disabled
-!! input
+!! wikitext
 {|
 |-
 | -{R|B}-
 |}
 {|
 |-
 | -{R|B}-
 |}
-!! result
+!! html
 <table>
 
 <tr>
 <table>
 
 <tr>
@@ -15464,9 +15702,9 @@ disabled
 
 !! test
 Bug 529: Uncovered bullet
 
 !! test
 Bug 529: Uncovered bullet
-!! input
+!! wikitext
 * Foo {{bullet}}
 * Foo {{bullet}}
-!! result
+!! html
 <ul>
 <li> Foo 
 </li>
 <ul>
 <li> Foo 
 </li>
@@ -15484,9 +15722,9 @@ Bug 529: Uncovered bullet
 # the expected output and your parser's output.
 !! test
 Bug 529: Uncovered bullet leaving empty list, normally removed by tidy
 # the expected output and your parser's output.
 !! test
 Bug 529: Uncovered bullet leaving empty list, normally removed by tidy
-!! input
+!! wikitext
 ******* Foo {{bullet}}
 ******* Foo {{bullet}}
-!! result
+!! html
 <ul>
 <li><ul>
 <li><ul>
 <ul>
 <li><ul>
 <li><ul>
@@ -15516,12 +15754,12 @@ Bug 529: Uncovered bullet leaving empty list, normally removed by tidy
 
 !! test
 Bug 529: Uncovered table already at line-start
 
 !! test
 Bug 529: Uncovered table already at line-start
-!! input
+!! wikitext
 x
 
 {{table}}
 y
 x
 
 {{table}}
 y
-!! result
+!! html
 <p>x
 </p>
 <table>
 <p>x
 </p>
 <table>
 
 !! test
 Bug 529: Uncovered bullet in parser function result
 
 !! test
 Bug 529: Uncovered bullet in parser function result
-!! input
+!! wikitext
 * Foo {{lc:{{bullet}} }}
 * Foo {{lc:{{bullet}} }}
-!! result
+!! html
 <ul>
 <li> Foo 
 </li>
 <ul>
 <li> Foo 
 </li>
@@ -15553,18 +15791,18 @@ Bug 529: Uncovered bullet in parser function result
 
 !! test
 Bug 5678: Double-parsed template argument
 
 !! test
 Bug 5678: Double-parsed template argument
-!! input
+!! wikitext
 {{lc:{{{1}}}|hello}}
 {{lc:{{{1}}}|hello}}
-!! result
+!! html
 <p>{{{1}}}
 </p>
 !! end
 
 !! test
 Bug 5678: Double-parsed template invocation
 <p>{{{1}}}
 </p>
 !! end
 
 !! test
 Bug 5678: Double-parsed template invocation
-!! input
+!! wikitext
 {{lc:{{paramtest {{!}} param = hello }} }}
 {{lc:{{paramtest {{!}} param = hello }} }}
-!! result
+!! html
 <p>{{paramtest | param = hello }}
 </p>
 !! end
 <p>{{paramtest | param = hello }}
 </p>
 !! end
@@ -15574,7 +15812,7 @@ Case insensitivity of parser functions for non-ASCII characters (bug 8143)
 !! options
 language=cs
 title=[[Main Page]]
 !! options
 language=cs
 title=[[Main Page]]
-!! input
+!! wikitext
 {{PRVNÍVELKÉ:ěščř}}
 {{prvnívelké:ěščř}}
 {{PRVNÍMALÉ:ěščř}}
 {{PRVNÍVELKÉ:ěščř}}
 {{prvnívelké:ěščř}}
 {{PRVNÍMALÉ:ěščř}}
@@ -15583,7 +15821,7 @@ title=[[Main Page]]
 {{malá:ěščř}}
 {{VELKÁ:ěščř}}
 {{velká:ěščř}}
 {{malá:ěščř}}
 {{VELKÁ:ěščř}}
 {{velká:ěščř}}
-!! result
+!! html
 <p>Ěščř
 Ěščř
 ěščř
 <p>Ěščř
 Ěščř
 ěščř
@@ -15597,10 +15835,10 @@ title=[[Main Page]]
 
 !! test
 Morwen/13: Unclosed link followed by heading
 
 !! test
 Morwen/13: Unclosed link followed by heading
-!! input
+!! wikitext
 [[link
 ==heading==
 [[link
 ==heading==
-!! result
+!! html
 <p>[[link
 </p>
 <h2><span class="mw-headline" id="heading">heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <p>[[link
 </p>
 <h2><span class="mw-headline" id="heading">heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
@@ -15609,10 +15847,10 @@ Morwen/13: Unclosed link followed by heading
 
 !! test
 HHP2.1: Heuristics for headings in preprocessor parenthetical structures
 
 !! test
 HHP2.1: Heuristics for headings in preprocessor parenthetical structures
-!! input
+!! wikitext
 {{foo|
 =heading=
 {{foo|
 =heading=
-!! result
+!! html
 <p>{{foo|
 </p>
 <h1><span class="mw-headline" id="heading">heading</span></h1>
 <p>{{foo|
 </p>
 <h1><span class="mw-headline" id="heading">heading</span></h1>
@@ -15621,10 +15859,10 @@ HHP2.1: Heuristics for headings in preprocessor parenthetical structures
 
 !! test
 HHP2.2: Heuristics for headings in preprocessor parenthetical structures
 
 !! test
 HHP2.2: Heuristics for headings in preprocessor parenthetical structures
-!! input
+!! wikitext
 {{foo|
 ==heading==
 {{foo|
 ==heading==
-!! result
+!! html
 <p>{{foo|
 </p>
 <h2><span class="mw-headline" id="heading">heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <p>{{foo|
 </p>
 <h2><span class="mw-headline" id="heading">heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
@@ -15635,19 +15873,19 @@ HHP2.2: Heuristics for headings in preprocessor parenthetical structures
 Tildes in comments
 !! options
 pst
 Tildes in comments
 !! options
 pst
-!! input
+!! wikitext
 <!-- ~~~~ -->
 <!-- ~~~~ -->
-!! result
+!! html
 <!-- ~~~~ -->
 !! end
 
 !! test
 Paragraphs inside divs (no extra line breaks)
 <!-- ~~~~ -->
 !! end
 
 !! test
 Paragraphs inside divs (no extra line breaks)
-!! input
+!! wikitext
 <div>Line one
 
 Line two</div>
 <div>Line one
 
 Line two</div>
-!! result
+!! html
 <div>Line one
 Line two</div>
 
 <div>Line one
 Line two</div>
 
@@ -15655,12 +15893,12 @@ Line two</div>
 
 !! test
 Paragraphs inside divs (extra line break on open)
 
 !! test
 Paragraphs inside divs (extra line break on open)
-!! input
+!! wikitext
 <div>
 Line one
 
 Line two</div>
 <div>
 Line one
 
 Line two</div>
-!! result
+!! html
 <div>
 <p>Line one
 </p>
 <div>
 <p>Line one
 </p>
@@ -15670,12 +15908,12 @@ Line two</div>
 
 !! test
 Paragraphs inside divs (extra line break on close)
 
 !! test
 Paragraphs inside divs (extra line break on close)
-!! input
+!! wikitext
 <div>Line one
 
 Line two
 </div>
 <div>Line one
 
 Line two
 </div>
-!! result
+!! html
 <div>Line one
 <p>Line two
 </p>
 <div>Line one
 <p>Line two
 </p>
@@ -15685,13 +15923,13 @@ Line two
 
 !! test
 Paragraphs inside divs (extra line break on open and close)
 
 !! test
 Paragraphs inside divs (extra line break on open and close)
-!! input
+!! wikitext
 <div>
 Line one
 
 Line two
 </div>
 <div>
 Line one
 
 Line two
 </div>
-!! result
+!! html
 <div>
 <p>Line one
 </p><p>Line two
 <div>
 <p>Line one
 </p><p>Line two
@@ -15704,10 +15942,10 @@ Line two
 Nesting tags, paragraphs on lines which begin with <div>
 !! options
 disabled
 Nesting tags, paragraphs on lines which begin with <div>
 !! options
 disabled
-!! input
+!! wikitext
 <div></div><strong>A
 B</strong>
 <div></div><strong>A
 B</strong>
-!! result
+!! html
 <div></div>
 <p><strong>A
 B</strong>
 <div></div>
 <p><strong>A
 B</strong>
@@ -15717,11 +15955,11 @@ B</strong>
 # Bug 6200: <blockquote> should behave like <div> with respect to line breaks
 !! test
 Bug 6200: paragraphs inside blockquotes (no extra line breaks)
 # Bug 6200: <blockquote> should behave like <div> with respect to line breaks
 !! test
 Bug 6200: paragraphs inside blockquotes (no extra line breaks)
-!! input
+!! wikitext
 <blockquote>Line one
 
 Line two</blockquote>
 <blockquote>Line one
 
 Line two</blockquote>
-!! result
+!! html
 <blockquote>Line one
 Line two</blockquote>
 
 <blockquote>Line one
 Line two</blockquote>
 
@@ -15729,12 +15967,12 @@ Line two</blockquote>
 
 !! test
 Bug 6200: paragraphs inside blockquotes (extra line break on open)
 
 !! test
 Bug 6200: paragraphs inside blockquotes (extra line break on open)
-!! input
+!! wikitext
 <blockquote>
 Line one
 
 Line two</blockquote>
 <blockquote>
 Line one
 
 Line two</blockquote>
-!! result
+!! html
 <blockquote>
 <p>Line one
 </p>
 <blockquote>
 <p>Line one
 </p>
@@ -15744,12 +15982,12 @@ Line two</blockquote>
 
 !! test
 Bug 6200: paragraphs inside blockquotes (extra line break on close)
 
 !! test
 Bug 6200: paragraphs inside blockquotes (extra line break on close)
-!! input
+!! wikitext
 <blockquote>Line one
 
 Line two
 </blockquote>
 <blockquote>Line one
 
 Line two
 </blockquote>
-!! result
+!! html
 <blockquote>Line one
 <p>Line two
 </p>
 <blockquote>Line one
 <p>Line two
 </p>
@@ -15759,13 +15997,13 @@ Line two
 
 !! test
 Bug 6200: paragraphs inside blockquotes (extra line break on open and close)
 
 !! test
 Bug 6200: paragraphs inside blockquotes (extra line break on open and close)
-!! input
+!! wikitext
 <blockquote>
 Line one
 
 Line two
 </blockquote>
 <blockquote>
 Line one
 
 Line two
 </blockquote>
-!! result
+!! html
 <blockquote>
 <p>Line one
 </p><p>Line two
 <blockquote>
 <p>Line one
 </p><p>Line two
@@ -15776,11 +16014,11 @@ Line two
 
 !! test
 Paragraphs inside blockquotes/divs (no extra line breaks)
 
 !! test
 Paragraphs inside blockquotes/divs (no extra line breaks)
-!! input
+!! wikitext
 <blockquote><div>Line one
 
 Line two</div></blockquote>
 <blockquote><div>Line one
 
 Line two</div></blockquote>
-!! result
+!! html
 <blockquote><div>Line one
 Line two</div></blockquote>
 
 <blockquote><div>Line one
 Line two</div></blockquote>
 
@@ -15788,12 +16026,12 @@ Line two</div></blockquote>
 
 !! test
 Paragraphs inside blockquotes/divs (extra line break on open)
 
 !! test
 Paragraphs inside blockquotes/divs (extra line break on open)
-!! input
+!! wikitext
 <blockquote><div>
 Line one
 
 Line two</div></blockquote>
 <blockquote><div>
 Line one
 
 Line two</div></blockquote>
-!! result
+!! html
 <blockquote><div>
 <p>Line one
 </p>
 <blockquote><div>
 <p>Line one
 </p>
@@ -15803,12 +16041,12 @@ Line two</div></blockquote>
 
 !! test
 Paragraphs inside blockquotes/divs (extra line break on close)
 
 !! test
 Paragraphs inside blockquotes/divs (extra line break on close)
-!! input
+!! wikitext
 <blockquote><div>Line one
 
 Line two
 </div></blockquote>
 <blockquote><div>Line one
 
 Line two
 </div></blockquote>
-!! result
+!! html
 <blockquote><div>Line one
 <p>Line two
 </p>
 <blockquote><div>Line one
 <p>Line two
 </p>
@@ -15818,13 +16056,13 @@ Line two
 
 !! test
 Paragraphs inside blockquotes/divs (extra line break on open and close)
 
 !! test
 Paragraphs inside blockquotes/divs (extra line break on open and close)
-!! input
+!! wikitext
 <blockquote><div>
 Line one
 
 Line two
 </div></blockquote>
 <blockquote><div>
 Line one
 
 Line two
 </div></blockquote>
-!! result
+!! html
 <blockquote><div>
 <p>Line one
 </p><p>Line two
 <blockquote><div>
 <p>Line one
 </p><p>Line two
@@ -15837,11 +16075,11 @@ Line two
 Interwiki links trounced by replaceExternalLinks after early LinkHolderArray expansion
 !! options
 wgLinkHolderBatchSize=0
 Interwiki links trounced by replaceExternalLinks after early LinkHolderArray expansion
 !! options
 wgLinkHolderBatchSize=0
-!! input
+!! wikitext
 [[meatball:1]]
 [[meatball:2]]
 [[meatball:3]]
 [[meatball:1]]
 [[meatball:2]]
 [[meatball:3]]
-!! result
+!! html
 <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><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>
@@ -15850,9 +16088,9 @@ wgLinkHolderBatchSize=0
 
 !! test
 Free external link invading image caption
 
 !! test
 Free external link invading image caption
-!! input
+!! wikitext
 [[Image:Foobar.jpg|thumb|http://x|hello]]
 [[Image:Foobar.jpg|thumb|http://x|hello]]
-!! result
+!! html
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>hello</div></div></div>
 
 !! end
 <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/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></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>hello</div></div></div>
 
 !! end
@@ -15861,54 +16099,54 @@ Free external link invading image caption
 Bug 15196: localised external link numbers
 !! options
 language=fa
 Bug 15196: localised external link numbers
 !! options
 language=fa
-!! input
+!! wikitext
 [http://en.wikipedia.org/]
 [http://en.wikipedia.org/]
-!! result
+!! html
 <p><a rel="nofollow" class="external autonumber" href="http://en.wikipedia.org/">[۱]</a>
 </p>
 !! end
 
 !! test
 Multibyte character in padleft
 <p><a rel="nofollow" class="external autonumber" href="http://en.wikipedia.org/">[۱]</a>
 </p>
 !! end
 
 !! test
 Multibyte character in padleft
-!! input
+!! wikitext
 {{padleft:-Hello|7|Æ}}
 {{padleft:-Hello|7|Æ}}
-!! result
+!! html
 <p>Æ-Hello
 </p>
 !! end
 
 !! test
 Multibyte character in padright
 <p>Æ-Hello
 </p>
 !! end
 
 !! test
 Multibyte character in padright
-!! input
+!! wikitext
 {{padright:Hello-|7|Æ}}
 {{padright:Hello-|7|Æ}}
-!! result
+!! html
 <p>Hello-Æ
 </p>
 !! end
 
 !!test
 formatdate parser function
 <p>Hello-Æ
 </p>
 !! end
 
 !!test
 formatdate parser function
-!!input
+!! wikitext
 {{#formatdate:2009-03-24}}
 {{#formatdate:2009-03-24}}
-!! result
+!! html
 <p><span class="mw-formatted-date" title="2009-03-24">2009-03-24</span>
 </p>
 !! end
 
 !!test
 formatdate parser function, with default format
 <p><span class="mw-formatted-date" title="2009-03-24">2009-03-24</span>
 </p>
 !! end
 
 !!test
 formatdate parser function, with default format
-!!input
+!! wikitext
 {{#formatdate:2009-03-24|mdy}}
 {{#formatdate:2009-03-24|mdy}}
-!! result
+!! html
 <p><span class="mw-formatted-date" title="2009-03-24">March 24, 2009</span>
 </p>
 !! end
 
 !! test
 Spacing of numbers in formatted dates
 <p><span class="mw-formatted-date" title="2009-03-24">March 24, 2009</span>
 </p>
 !! end
 
 !! test
 Spacing of numbers in formatted dates
-!! input
+!! wikitext
 {{#formatdate:January 15}}
 {{#formatdate:January 15}}
-!! result
+!! html
 <p><span class="mw-formatted-date" title="01-15">January 15</span>
 </p>
 !! end
 <p><span class="mw-formatted-date" title="01-15">January 15</span>
 </p>
 !! end
@@ -15917,9 +16155,9 @@ Spacing of numbers in formatted dates
 formatdate parser function, with default format and on a page of which the content language is always English and different from the wiki content language
 !! options
 language=nl title=[[MediaWiki:Common.css]]
 formatdate parser function, with default format and on a page of which the content language is always English and different from the wiki content language
 !! options
 language=nl title=[[MediaWiki:Common.css]]
-!! input
+!! wikitext
 {{#formatdate:2009-03-24|dmy}}
 {{#formatdate:2009-03-24|dmy}}
-!! result
+!! html
 <p><span class="mw-formatted-date" title="2009-03-24">24 March 2009</span>
 </p>
 !! end
 <p><span class="mw-formatted-date" title="2009-03-24">24 March 2009</span>
 </p>
 !! end
@@ -15936,9 +16174,9 @@ language=nl title=[[MediaWiki:Common.css]]
 Edit comment with link
 !! options
 comment
 Edit comment with link
 !! options
 comment
-!! input
+!! wikitext
 I like the [[Main Page]] a lot
 I like the [[Main Page]] a lot
-!! result
+!! html
 I like the <a href="/wiki/Main_Page" title="Main Page">Main Page</a> a lot
 !!end
 
 I like the <a href="/wiki/Main_Page" title="Main Page">Main Page</a> a lot
 !!end
 
@@ -15946,9 +16184,9 @@ I like the <a href="/wiki/Main_Page" title="Main Page">Main Page</a> a lot
 Edit comment with link and link text
 !! options
 comment
 Edit comment with link and link text
 !! options
 comment
-!! input
+!! wikitext
 I like the [[Main Page|best pages]] a lot
 I like the [[Main Page|best pages]] a lot
-!! result
+!! html
 I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
 !!end
 
 I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
 !!end
 
@@ -15956,9 +16194,9 @@ I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
 Edit comment with link and link text with suffix
 !! options
 comment
 Edit comment with link and link text with suffix
 !! options
 comment
-!! input
+!! wikitext
 I like the [[Main Page|best page]]s a lot
 I like the [[Main Page|best page]]s a lot
-!! result
+!! html
 I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
 !!end
 
 I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
 !!end
 
@@ -15966,9 +16204,9 @@ I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
 Edit comment with section link (non-local, eg in history list)
 !! options
 comment title=[[Main Page]]
 Edit comment with section link (non-local, eg in history list)
 !! options
 comment title=[[Main Page]]
-!! input
+!! wikitext
 /* External links */ removed bogus entries
 /* External links */ removed bogus entries
-!! result
+!! html
 <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
 
 <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
 
@@ -15976,9 +16214,9 @@ comment title=[[Main Page]]
 Edit comment with section link and text before it (non-local, eg in history list)
 !! options
 comment title=[[Main Page]]
 Edit comment with section link and text before it (non-local, eg in history list)
 !! options
 comment title=[[Main Page]]
-!! input
+!! wikitext
 pre-comment text /* External links */ removed bogus entries
 pre-comment text /* External links */ removed bogus entries
-!! result
+!! html
 pre-comment text <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
 
 pre-comment text <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
 
@@ -15986,9 +16224,9 @@ pre-comment text <a href="/wiki/Main_Page#External_links" title="Main Page">→<
 Edit comment with section link (local, eg in diff view)
 !! options
 comment local title=[[Main Page]]
 Edit comment with section link (local, eg in diff view)
 !! options
 comment local title=[[Main Page]]
-!! input
+!! wikitext
 /* External links */ removed bogus entries
 /* External links */ removed bogus entries
-!! result
+!! html
 <a href="#External_links">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
 !!end
 
 <a href="#External_links">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
 !!end
 
@@ -15998,9 +16236,9 @@ Edit comment with subpage link (bug 14080)
 comment
 subpage
 title=[[Subpage test]]
 comment
 subpage
 title=[[Subpage test]]
-!! input
+!! wikitext
 Poked at a [[/subpage]] here...
 Poked at a [[/subpage]] here...
-!! result
+!! html
 Poked at a <a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a> here...
 !!end
 
 Poked at a <a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a> here...
 !!end
 
@@ -16010,9 +16248,9 @@ Edit comment with subpage link and link text (bug 14080)
 comment
 subpage
 title=[[Subpage test]]
 comment
 subpage
 title=[[Subpage test]]
-!! input
+!! wikitext
 Poked at a [[/subpage|neat little page]] here...
 Poked at a [[/subpage|neat little page]] here...
-!! result
+!! html
 Poked at a <a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">neat little page</a> here...
 !!end
 
 Poked at a <a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">neat little page</a> here...
 !!end
 
@@ -16021,9 +16259,9 @@ Edit comment with bogus subpage link in non-subpage NS (bug 14080)
 !! options
 comment
 title=[[Subpage test]]
 !! options
 comment
 title=[[Subpage test]]
-!! input
+!! wikitext
 Poked at a [[/subpage]] here...
 Poked at a [[/subpage]] here...
-!! result
+!! html
 Poked at a <a href="/index.php?title=/subpage&amp;action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a> here...
 !!end
 
 Poked at a <a href="/index.php?title=/subpage&amp;action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a> here...
 !!end
 
@@ -16033,9 +16271,9 @@ Edit comment with bare anchor link (local, as on diff)
 comment
 local
 title=[[Main Page]]
 comment
 local
 title=[[Main Page]]
-!!input
+!! wikitext
 [[#section]]
 [[#section]]
-!! result
+!! html
 <a href="#section">#section</a>
 !! end
 
 <a href="#section">#section</a>
 !! end
 
@@ -16044,26 +16282,26 @@ Edit comment with bare anchor link (non-local, as on history)
 !! options
 comment
 title=[[Main Page]]
 !! options
 comment
 title=[[Main Page]]
-!!input
+!! wikitext
 [[#section]]
 [[#section]]
-!! result
+!! html
 <a href="/wiki/Main_Page#section" title="Main Page">#section</a>
 !! end
 
 !! test
 Anchor starting with underscore
 <a href="/wiki/Main_Page#section" title="Main Page">#section</a>
 !! end
 
 !! test
 Anchor starting with underscore
-!!input
+!! wikitext
 [[#_ref|One]]
 [[#_ref|One]]
-!! result
+!! html
 <p><a href="#_ref">One</a>
 </p>
 !! end
 
 !! test
 Id starting with underscore
 <p><a href="#_ref">One</a>
 </p>
 !! end
 
 !! test
 Id starting with underscore
-!!input
+!! wikitext
 <div id="_ref"></div>
 <div id="_ref"></div>
-!! result
+!! html
 <div id="_ref"></div>
 
 !! end
 <div id="_ref"></div>
 
 !! end
@@ -16073,9 +16311,9 @@ Space normalisation on autocomment (bug 22784)
 !! options
 comment
 title=[[Main Page]]
 !! options
 comment
 title=[[Main Page]]
-!!input
+!! wikitext
 /* __hello__world__ */
 /* __hello__world__ */
-!! result
+!! html
 <a href="/wiki/Main_Page#hello_world" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">__hello__world__</span></span>
 !! end
 
 <a href="/wiki/Main_Page#hello_world" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">__hello__world__</span></span>
 !! end
 
@@ -16083,9 +16321,9 @@ title=[[Main Page]]
 percent-encoding and + signs in comments (Bug 26410)
 !! options
 comment
 percent-encoding and + signs in comments (Bug 26410)
 !! options
 comment
-!!input
+!! wikitext
 [[ABC%33D% ++]] [[ABC%33D% ++|+%20]]
 [[ABC%33D% ++]] [[ABC%33D% ++|+%20]]
-!! result
+!! html
 <a href="/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">ABC3D% ++</a> <a href="/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">+%20</a>
 !! end
 
 <a href="/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">ABC3D% ++</a> <a href="/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">+%20</a>
 !! end
 
@@ -16093,20 +16331,20 @@ comment
 Bad images - basic functionality
 !! options
 disabled
 Bad images - basic functionality
 !! options
 disabled
-!! input
+!! wikitext
 [[File:Bad.jpg]]
 [[File:Bad.jpg]]
-!! result
+!! html
 !! end
 
 !! test
 Bad images - bug 16039: text after bad image disappears
 !! options
 disabled
 !! end
 
 !! test
 Bad images - bug 16039: text after bad image disappears
 !! options
 disabled
-!! input
+!! wikitext
 Foo bar
 [[File:Bad.jpg]]
 Bar foo
 Foo bar
 [[File:Bad.jpg]]
 Bar foo
-!! result
+!! html
 <p>Foo bar
 </p><p>Bar foo
 </p>
 <p>Foo bar
 </p><p>Bar foo
 </p>
@@ -16119,9 +16357,9 @@ showtitle
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=false
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=false
-!! input
+!! wikitext
 this is not the the title
 this is not the the title
-!! result
+!! html
 Parser test
 <p>this is not the the title
 </p>
 Parser test
 <p>this is not the the title
 </p>
@@ -16135,10 +16373,10 @@ title=[[Screen]]
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=false
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=false
-!! input
+!! wikitext
 this is not the the title
 {{DISPLAYTITLE:whatever}}
 this is not the the title
 {{DISPLAYTITLE:whatever}}
-!! result
+!! html
 whatever
 <p>this is not the the title
 </p>
 whatever
 <p>this is not the the title
 </p>
@@ -16152,10 +16390,10 @@ title=[[Screen]]
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=true
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=true
-!! input
+!! wikitext
 this is not the the title
 {{DISPLAYTITLE:whatever}}
 this is not the the title
 {{DISPLAYTITLE:whatever}}
-!! result
+!! html
 Screen
 <p>this is not the the title
 </p>
 Screen
 <p>this is not the the title
 </p>
@@ -16169,10 +16407,10 @@ title=[[Screen]]
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=true
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=true
-!! input
+!! wikitext
 this is not the the title
 {{DISPLAYTITLE:screen}}
 this is not the the title
 {{DISPLAYTITLE:screen}}
-!! result
+!! html
 screen
 <p>this is not the the title
 </p>
 screen
 <p>this is not the the title
 </p>
@@ -16185,10 +16423,10 @@ showtitle
 title=[[Screen]]
 !! config
 wgAllowDisplayTitle=false
 title=[[Screen]]
 !! config
 wgAllowDisplayTitle=false
-!! input
+!! wikitext
 this is not the the title
 {{DISPLAYTITLE:screen}}
 this is not the the title
 {{DISPLAYTITLE:screen}}
-!! result
+!! html
 Screen
 <p>this is not the the title
 <a href="/index.php?title=Template:DISPLAYTITLE:screen&amp;action=edit&amp;redlink=1" class="new" title="Template:DISPLAYTITLE:screen (page does not exist)">Template:DISPLAYTITLE:screen</a>
 Screen
 <p>this is not the the title
 <a href="/index.php?title=Template:DISPLAYTITLE:screen&amp;action=edit&amp;redlink=1" class="new" title="Template:DISPLAYTITLE:screen (page does not exist)">Template:DISPLAYTITLE:screen</a>
@@ -16202,9 +16440,9 @@ showtitle
 title=[[Screen]]
 !! config
 wgAllowDisplayTitle=false
 title=[[Screen]]
 !! config
 wgAllowDisplayTitle=false
-!! input
+!! wikitext
 this is not the the title
 this is not the the title
-!! result
+!! html
 Screen
 <p>this is not the the title
 </p>
 Screen
 <p>this is not the the title
 </p>
@@ -16218,10 +16456,10 @@ title=[[Screen]]
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=true
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=true
-!! input
+!! wikitext
 this is not the the title
 {{DISPLAYTITLE:<span style="display: none;">s</span>creen}}
 this is not the the title
 {{DISPLAYTITLE:<span style="display: none;">s</span>creen}}
-!! result
+!! html
 <span style="/* attempt to bypass $wgRestrictDisplayTitle */">s</span>creen
 <p>this is not the the title
 </p>
 <span style="/* attempt to bypass $wgRestrictDisplayTitle */">s</span>creen
 <p>this is not the the title
 </p>
@@ -16235,10 +16473,10 @@ title=[[Screen]]
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=true
 !! config
 wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=true
-!! input
+!! wikitext
 this is not the the title
 {{DISPLAYTITLE:<span style="color: red;">s</span>creen}}
 this is not the the title
 {{DISPLAYTITLE:<span style="color: red;">s</span>creen}}
-!! result
+!! html
 <span style="color: red;">s</span>creen
 <p>this is not the the title
 </p>
 <span style="color: red;">s</span>creen
 <p>this is not the the title
 </p>
@@ -16248,9 +16486,9 @@ this is not the the title
 preload: check <noinclude> and <includeonly>
 !! options
 preload
 preload: check <noinclude> and <includeonly>
 !! options
 preload
-!! input
+!! wikitext
 Hello <noinclude>cruel</noinclude><includeonly>kind</includeonly> world.
 Hello <noinclude>cruel</noinclude><includeonly>kind</includeonly> world.
-!! result
+!! html
 Hello kind world.
 !! end
 
 Hello kind world.
 !! end
 
@@ -16258,9 +16496,9 @@ Hello kind world.
 preload: check <onlyinclude>
 !! options
 preload
 preload: check <onlyinclude>
 !! options
 preload
-!! input
+!! wikitext
 Goodbye <onlyinclude>Hello world</onlyinclude>
 Goodbye <onlyinclude>Hello world</onlyinclude>
-!! result
+!! html
 Hello world
 !! end
 
 Hello world
 !! end
 
@@ -16268,9 +16506,9 @@ Hello world
 preload: can pass tags through if we want to
 !! options
 preload
 preload: can pass tags through if we want to
 !! options
 preload
-!! input
+!! wikitext
 <includeonly><</includeonly>includeonly>Hello world<includeonly><</includeonly>/includeonly>
 <includeonly><</includeonly>includeonly>Hello world<includeonly><</includeonly>/includeonly>
-!! result
+!! html
 <includeonly>Hello world</includeonly>
 !! end
 
 <includeonly>Hello world</includeonly>
 !! end
 
@@ -16278,9 +16516,9 @@ preload
 preload: check that it doesn't try to do tricks
 !! options
 preload
 preload: check that it doesn't try to do tricks
 !! options
 preload
-!! input
+!! wikitext
 * <!-- Hello --> ''{{world}}'' {{<includeonly>subst:</includeonly>How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
 * <!-- Hello --> ''{{world}}'' {{<includeonly>subst:</includeonly>How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
-!! result
+!! html
 * <!-- Hello --> ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
 !! end
 
 * <!-- Hello --> ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
 !! end
 
@@ -16288,12 +16526,12 @@ preload
 Play a bit with r67090 and bug 3158
 !! options
 disabled
 Play a bit with r67090 and bug 3158
 !! options
 disabled
-!! input
+!! wikitext
 <div style="width:50% !important">&nbsp;</div>
 <div style="width:50%&nbsp;!important">&nbsp;</div>
 <div style="width:50%&#160;!important">&nbsp;</div>
 <div style="border : solid;">&nbsp;</div>
 <div style="width:50% !important">&nbsp;</div>
 <div style="width:50%&nbsp;!important">&nbsp;</div>
 <div style="width:50%&#160;!important">&nbsp;</div>
 <div style="border : solid;">&nbsp;</div>
-!! result
+!! html
 <div style="width:50% !important">&nbsp;</div>
 <div style="width:50% !important">&nbsp;</div>
 <div style="width:50% !important">&nbsp;</div>
 <div style="width:50% !important">&nbsp;</div>
 <div style="width:50% !important">&nbsp;</div>
 <div style="width:50% !important">&nbsp;</div>
@@ -16303,10 +16541,10 @@ disabled
 
 !! test
 HTML5 data attributes
 
 !! test
 HTML5 data attributes
-!! input
+!! wikitext
 <span data-foo="bar">Baz</span>
 <p data-abc-def_hij="">Quuz</p>
 <span data-foo="bar">Baz</span>
 <p data-abc-def_hij="">Quuz</p>
-!! result
+!! html
 <p><span data-foo="bar">Baz</span>
 </p>
 <p data-abc-def_hij="">Quuz</p>
 <p><span data-foo="bar">Baz</span>
 </p>
 <p data-abc-def_hij="">Quuz</p>
@@ -16315,12 +16553,12 @@ HTML5 data attributes
 
 !! test
 percent-encoding and + signs in internal links (Bug 26410)
 
 !! test
 percent-encoding and + signs in internal links (Bug 26410)
-!! input
+!! wikitext
 [[User:+%]] [[Page+title%]]
 [[%+]] [[%+|%20]] [[%+ ]] [[%+r]]
 [[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]]
 [[%33%45]] [[%33%45+]]
 [[User:+%]] [[Page+title%]]
 [[%+]] [[%+|%20]] [[%+ ]] [[%+r]]
 [[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]]
 [[%33%45]] [[%33%45+]]
-!! result
+!! html
 <p><a href="/index.php?title=User:%2B%25&amp;action=edit&amp;redlink=1" class="new" title="User:+% (page does not exist)">User:+%</a> <a href="/index.php?title=Page%2Btitle%25&amp;action=edit&amp;redlink=1" class="new" title="Page+title% (page does not exist)">Page+title%</a>
 <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+</a> <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%20</a> <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+ </a> <a href="/index.php?title=%25%2Br&amp;action=edit&amp;redlink=1" class="new" title="%+r (page does not exist)">%+r</a>
 <a href="/index.php?title=%25&amp;action=edit&amp;redlink=1" class="new" title="% (page does not exist)">%</a> <a href="/index.php?title=%2B&amp;action=edit&amp;redlink=1" class="new" title="+ (page does not exist)">+</a> <a href="/index.php?title=Special:Upload&amp;wpDestFile=%25%2Babc9" class="new" title="File:%+abc9">bar</a>
 <p><a href="/index.php?title=User:%2B%25&amp;action=edit&amp;redlink=1" class="new" title="User:+% (page does not exist)">User:+%</a> <a href="/index.php?title=Page%2Btitle%25&amp;action=edit&amp;redlink=1" class="new" title="Page+title% (page does not exist)">Page+title%</a>
 <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+</a> <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%20</a> <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+ </a> <a href="/index.php?title=%25%2Br&amp;action=edit&amp;redlink=1" class="new" title="%+r (page does not exist)">%+r</a>
 <a href="/index.php?title=%25&amp;action=edit&amp;redlink=1" class="new" title="% (page does not exist)">%</a> <a href="/index.php?title=%2B&amp;action=edit&amp;redlink=1" class="new" title="+ (page does not exist)">+</a> <a href="/index.php?title=Special:Upload&amp;wpDestFile=%25%2Babc9" class="new" title="File:%+abc9">bar</a>
@@ -16330,10 +16568,10 @@ percent-encoding and + signs in internal links (Bug 26410)
 
 !! test
 Special characters in embedded file links (bug 27679)
 
 !! test
 Special characters in embedded file links (bug 27679)
-!! input
+!! wikitext
 [[File:Contains & ampersand.jpg]]
 [[File:Does not exist.jpg|Title with & ampersand]]
 [[File:Contains & ampersand.jpg]]
 [[File:Does not exist.jpg|Title with & ampersand]]
-!! result
+!! html
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains &amp; ampersand.jpg">File:Contains &amp; ampersand.jpg</a>
 <a href="/index.php?title=Special:Upload&amp;wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with &amp; ampersand</a>
 </p>
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains &amp; ampersand.jpg">File:Contains &amp; ampersand.jpg</a>
 <a href="/index.php?title=Special:Upload&amp;wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with &amp; ampersand</a>
 </p>
@@ -16342,36 +16580,36 @@ Special characters in embedded file links (bug 27679)
 
 !! test
 Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4)
 
 !! test
 Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4)
-!! input
+!! wikitext
 Text&apos;s been normalized?
 Text&apos;s been normalized?
-!! result
+!! html
 <p>Text&#39;s been normalized?
 </p>
 !! end
 
 !! test
 Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate free external links
 <p>Text&#39;s been normalized?
 </p>
 !! end
 
 !! test
 Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate free external links
-!! input
+!! wikitext
 http://www.example.org/ <-- U+3000 (vim: ^Vu3000)
 http://www.example.org/ <-- U+3000 (vim: ^Vu3000)
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="http://www.example.org/">http://www.example.org/</a> &lt;-- U+3000 (vim: ^Vu3000)
 </p>
 !! end
 
 !! test
 Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links
 <p><a rel="nofollow" class="external free" href="http://www.example.org/">http://www.example.org/</a> &lt;-- U+3000 (vim: ^Vu3000)
 </p>
 !! end
 
 !! test
 Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links
-!! input
+!! wikitext
 [http://www.example.org/ ideograms]
 [http://www.example.org/ ideograms]
-!! result
+!! html
 <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
 <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
+!! wikitext
 http://www.example.org/pic.png <-- U+3000 (vim: ^Vu3000)
 http://www.example.org/pic.png <-- U+3000 (vim: ^Vu3000)
-!! result
+!! html
 <p><img src="http://www.example.org/pic.png" alt="pic.png" /> &lt;-- U+3000 (vim: ^Vu3000)
 </p>
 !! end
 <p><img src="http://www.example.org/pic.png" alt="pic.png" /> &lt;-- U+3000 (vim: ^Vu3000)
 </p>
 !! end
@@ -16397,9 +16635,9 @@ Template:Identical
 
 !! test
 Bug 31098 Template which includes system messages which includes the template
 
 !! test
 Bug 31098 Template which includes system messages which includes the template
-!! input
+!! wikitext
 {{Identical}}
 {{Identical}}
-!! result
+!! html
 <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>
 <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>
@@ -16409,9 +16647,9 @@ Bug 31098 Template which includes system messages which includes the template
 Bug31490 Turkish: ucfirst 'blah'
 !! options
 language=tr
 Bug31490 Turkish: ucfirst 'blah'
 !! options
 language=tr
-!! input
+!! wikitext
 {{ucfirst:blah}}
 {{ucfirst:blah}}
-!! result
+!! html
 <p>Blah
 </p>
 !! end
 <p>Blah
 </p>
 !! end
@@ -16420,9 +16658,9 @@ language=tr
 Bug31490 Turkish: ucfirst 'ix'
 !! options
 language=tr
 Bug31490 Turkish: ucfirst 'ix'
 !! options
 language=tr
-!! input
+!! wikitext
 {{ucfirst:ix}}
 {{ucfirst:ix}}
-!! result
+!! html
 <p>İx
 </p>
 !! end
 <p>İx
 </p>
 !! end
@@ -16431,9 +16669,9 @@ language=tr
 Bug31490 Turkish: lcfirst 'BLAH'
 !! options
 language=tr
 Bug31490 Turkish: lcfirst 'BLAH'
 !! options
 language=tr
-!! input
+!! wikitext
 {{lcfirst:BLAH}}
 {{lcfirst:BLAH}}
-!! result
+!! html
 <p>bLAH
 </p>
 !! end
 <p>bLAH
 </p>
 !! end
@@ -16442,9 +16680,9 @@ language=tr
 Bug31490 Turkish: ucfırst (with a dotless i)
 !! options
 language=tr
 Bug31490 Turkish: ucfırst (with a dotless i)
 !! options
 language=tr
-!! input
+!! wikitext
 {{ucfırst:blah}}
 {{ucfırst:blah}}
-!! result
+!! html
 <p><a href="/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Şablon:Ucfırst:blah (sayfa mevcut değil)">Şablon:Ucfırst:blah</a>
 </p>
 !! end
 <p><a href="/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Şablon:Ucfırst:blah (sayfa mevcut değil)">Şablon:Ucfırst:blah</a>
 </p>
 !! end
@@ -16453,9 +16691,9 @@ language=tr
 Bug31490 ucfırst (with a dotless i) with English language
 !! options
 language=en
 Bug31490 ucfırst (with a dotless i) with English language
 !! options
 language=en
-!! input
+!! wikitext
 {{ucfırst:blah}}
 {{ucfırst:blah}}
-!! result
+!! html
 <p><a href="/index.php?title=Template:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Template:Ucfırst:blah (page does not exist)">Template:Ucfırst:blah</a>
 </p>
 !! end
 <p><a href="/index.php?title=Template:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Template:Ucfırst:blah (page does not exist)">Template:Ucfırst:blah</a>
 </p>
 !! end
@@ -16464,10 +16702,10 @@ language=en
 Bug 26375: TOC with italics
 !! options
 title=[[Main Page]]
 Bug 26375: TOC with italics
 !! options
 title=[[Main Page]]
-!! input
+!! wikitext
 __TOC__
 == ''Lost'' episodes ==
 __TOC__
 == ''Lost'' episodes ==
-!! result
+!! html
 <div id="toc" class="toc"><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>
 <div id="toc" class="toc"><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>
@@ -16482,10 +16720,10 @@ __TOC__
 Bug 26375: TOC with bold
 !! options
 title=[[Main Page]]
 Bug 26375: TOC with bold
 !! options
 title=[[Main Page]]
-!! input
+!! wikitext
 __TOC__
 == '''should be bold''' then normal text ==
 __TOC__
 == '''should be bold''' then normal text ==
-!! result
+!! html
 <div id="toc" class="toc"><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>
 <div id="toc" class="toc"><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>
@@ -16500,10 +16738,10 @@ __TOC__
 Bug 33845: Headings become cursive in TOC when they contain an image
 !! options
 title=[[Main Page]]
 Bug 33845: Headings become cursive in TOC when they contain an image
 !! options
 title=[[Main Page]]
-!! input
+!! wikitext
 __TOC__
 == Image [[Image:foobar.jpg]] ==
 __TOC__
 == Image [[Image:foobar.jpg]] ==
-!! result
+!! html
 <div id="toc" class="toc"><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>
 <div id="toc" class="toc"><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>
@@ -16518,10 +16756,10 @@ __TOC__
 Bug 33845 (2): Headings become bold in TOC when they contain a blockquote
 !! options
 title=[[Main Page]]
 Bug 33845 (2): Headings become bold in TOC when they contain a blockquote
 !! options
 title=[[Main Page]]
-!! input
+!! wikitext
 __TOC__
 == <blockquote>Quote</blockquote> ==
 __TOC__
 == <blockquote>Quote</blockquote> ==
-!! result
+!! html
 <div id="toc" class="toc"><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>
 <div id="toc" class="toc"><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>
@@ -16536,12 +16774,12 @@ __TOC__
 Unclosed tags in TOC
 !! options
 title=[[Main Page]]
 Unclosed tags in TOC
 !! options
 title=[[Main Page]]
-!! input
+!! wikitext
 __TOC__
 == Proof: 2 < 3 ==
 <small>Hanc marginis exiguitas non caperet.</small>
 QED
 __TOC__
 == Proof: 2 < 3 ==
 <small>Hanc marginis exiguitas non caperet.</small>
 QED
-!! result
+!! html
 <div id="toc" class="toc"><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 &lt; 3</span></a></li>
 <div id="toc" class="toc"><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 &lt; 3</span></a></li>
@@ -16556,12 +16794,12 @@ QED
 
 !! test
 Multiple tags in TOC
 
 !! test
 Multiple tags in TOC
-!! input
+!! wikitext
 __TOC__
 == <i>Foo</i> <b>Bar</b> ==
 
 == <i>Foo</i> <blockquote>Bar</blockquote> ==
 __TOC__
 == <i>Foo</i> <b>Bar</b> ==
 
 == <i>Foo</i> <blockquote>Bar</blockquote> ==
-!! result
+!! html
 <div id="toc" class="toc"><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>
 <div id="toc" class="toc"><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>
@@ -16576,12 +16814,12 @@ __TOC__
 
 !! test
 Tags with parameters in TOC
 
 !! test
 Tags with parameters in TOC
-!! input
+!! wikitext
 __TOC__
 == <sup class="in-h2">Hello</sup> ==
 
 == <sup class="a > b">Evilbye</sup> ==
 __TOC__
 == <sup class="in-h2">Hello</sup> ==
 
 == <sup class="a > b">Evilbye</sup> ==
-!! result
+!! html
 <div id="toc" class="toc"><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>
 <div id="toc" class="toc"><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>
@@ -16596,7 +16834,7 @@ __TOC__
 
 !! test
 span tags with directionality in TOC
 
 !! test
 span tags with directionality in TOC
-!! input
+!! wikitext
 __TOC__
 == <span dir="ltr">C++</span> ==
 
 __TOC__
 == <span dir="ltr">C++</span> ==
 
@@ -16607,7 +16845,7 @@ __TOC__
 == <span style="font-style: italic" dir="ltr">All attributes on these span tags must be deleted from the TOC</span> ==
 
 == <span dir="ltr" style="font-style: italic">Attributes after dir on these span tags must be deleted from the TOC</span> ==
 == <span style="font-style: italic" dir="ltr">All attributes on these span tags must be deleted from the TOC</span> ==
 
 == <span dir="ltr" style="font-style: italic">Attributes after dir on these span tags must be deleted from the TOC</span> ==
-!! result
+!! html
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#C.2B.2B"><span class="tocnumber">1</span> <span class="toctext"><span dir="ltr">C++</span></span></a></li>
 <div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
 <ul>
 <li class="toclevel-1 tocsection-1"><a href="#C.2B.2B"><span class="tocnumber">1</span> <span class="toctext"><span dir="ltr">C++</span></span></a></li>
@@ -16636,20 +16874,20 @@ MediaWiki:Bug32057
 Bug 32057: Title needed when expanding <h> nodes.
 !! options
 title=[[Main Page]]
 Bug 32057: Title needed when expanding <h> nodes.
 !! options
 title=[[Main Page]]
-!! input
+!! wikitext
 {{int:Bug32057}}
 {{int:Bug32057}}
-!! result
+!! html
 <h2><span class="mw-headline" id="Headline_text">Headline text</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Headline text">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
 
 !! test
 Strip marker in urlencode
 <h2><span class="mw-headline" id="Headline_text">Headline text</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Headline text">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
 
 !! test
 Strip marker in urlencode
-!! input
+!! wikitext
 {{urlencode:x<nowiki/>y}}
 {{urlencode:x<nowiki/>y|wiki}}
 {{urlencode:x<nowiki/>y|path}}
 {{urlencode:x<nowiki/>y}}
 {{urlencode:x<nowiki/>y|wiki}}
 {{urlencode:x<nowiki/>y|path}}
-!! result
+!! html
 <p>xy
 xy
 xy
 <p>xy
 xy
 xy
 
 !! test
 Strip marker in lc
 
 !! test
 Strip marker in lc
-!! input
+!! wikitext
 {{lc:x<nowiki/>y}}
 {{lc:x<nowiki/>y}}
-!! result
+!! html
 <p>xy
 </p>
 !! end
 
 !! test
 Strip marker in uc
 <p>xy
 </p>
 !! end
 
 !! test
 Strip marker in uc
-!! input
+!! wikitext
 {{uc:x<nowiki/>y}}
 {{uc:x<nowiki/>y}}
-!! result
+!! html
 <p>XY
 </p>
 !! end
 
 !! test
 Strip marker in formatNum
 <p>XY
 </p>
 !! end
 
 !! test
 Strip marker in formatNum
-!! input
+!! wikitext
 {{formatnum:1<nowiki/>2}}
 {{formatnum:1<nowiki/>2|R}}
 {{formatnum:1<nowiki/>2}}
 {{formatnum:1<nowiki/>2|R}}
-!! result
+!! html
 <p>12
 12
 </p>
 <p>12
 12
 </p>
@@ -16689,10 +16927,10 @@ Strip marker in formatNum
 Check noCommafy in formatNum
 !! options
 language=be-tarask
 Check noCommafy in formatNum
 !! options
 language=be-tarask
-!! input
+!! wikitext
 {{formatnum:123456.78}}
 {{formatnum:123456.78|NOSEP}}
 {{formatnum:123456.78}}
 {{formatnum:123456.78|NOSEP}}
-!! result
+!! html
 <p>123 456,78
 123456.78
 </p>
 <p>123 456,78
 123456.78
 </p>
@@ -16700,11 +16938,11 @@ language=be-tarask
 
 !! test
 Wrong option for formatNum (bug 56199)
 
 !! test
 Wrong option for formatNum (bug 56199)
-!! input
+!! wikitext
 {{formatnum:1,234.56|Random}}
 {{formatnum:1,234.56|EVERYTHING}}
 {{formatnum:1234.56|any argument that has the string 'NOSEP'}}
 {{formatnum:1,234.56|Random}}
 {{formatnum:1,234.56|EVERYTHING}}
 {{formatnum:1234.56|any argument that has the string 'NOSEP'}}
-!! result
+!! html
 <p>1,234.56
 1,234.56
 1,234.56
 <p>1,234.56
 1,234.56
 1,234.56
@@ -16715,67 +16953,67 @@ Wrong option for formatNum (bug 56199)
 Strip marker in grammar
 !! options
 language=fi
 Strip marker in grammar
 !! options
 language=fi
-!! input
+!! wikitext
 {{grammar:elative|foo<nowiki/>bar}}
 {{grammar:elative|foo<nowiki/>bar}}
-!! result
+!! html
 <p>foobarista
 </p>
 !! end
 
 !! test
 Strip marker in padleft
 <p>foobarista
 </p>
 !! end
 
 !! test
 Strip marker in padleft
-!! input
+!! wikitext
 {{padleft:|2|x<nowiki/>y}}
 {{padleft:|2|x<nowiki/>y}}
-!! result
+!! html
 <p>xy
 </p>
 !! end
 
 !! test
 Strip marker in padright
 <p>xy
 </p>
 !! end
 
 !! test
 Strip marker in padright
-!! input
+!! wikitext
 {{padright:|2|x<nowiki/>y}}
 {{padright:|2|x<nowiki/>y}}
-!! result
+!! html
 <p>xy
 </p>
 !! end
 
 !! test
 Strip marker in anchorencode
 <p>xy
 </p>
 !! end
 
 !! test
 Strip marker in anchorencode
-!! input
+!! wikitext
 {{anchorencode:x<nowiki/>y}}
 {{anchorencode:x<nowiki/>y}}
-!! result
+!! html
 <p>xy
 </p>
 !! end
 
 !! test
 nowiki inside link inside heading (bug 18295)
 <p>xy
 </p>
 !! end
 
 !! test
 nowiki inside link inside heading (bug 18295)
-!! input
+!! wikitext
 ==[[foo|x<nowiki>y</nowiki>z]]==
 ==[[foo|x<nowiki>y</nowiki>z]]==
-!! result
+!! html
 <h2><span class="mw-headline" id="xyz"><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">xyz</a></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: xyz">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
 
 !! test
 new support for bdi element (bug 31817)
 <h2><span class="mw-headline" id="xyz"><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">xyz</a></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: xyz">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
 
 !! test
 new support for bdi element (bug 31817)
-!! input
+!! wikitext
 <p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
 <p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
-!! result
+!! html
 <p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
 
 !!end
 
 !! test
 Ignore pipe between table row attributes
 <p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
 
 !!end
 
 !! test
 Ignore pipe between table row attributes
-!! input
+!! wikitext
 {|
 | quux
 |- id=foo | style='color: red'
 | bar
 |}
 {|
 | quux
 |- id=foo | style='color: red'
 | bar
 |}
-!! result
+!! html
 <table>
 <tr>
 <td> quux
 <table>
 <tr>
 <td> quux
@@ -16788,11 +17026,11 @@ Ignore pipe between table row attributes
 
 !!test
 Gallery override link with WikiLink (bug 34852)
 
 !!test
 Gallery override link with WikiLink (bug 34852)
-!! input
+!! wikitext
 <gallery>
 File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink
 </gallery>
 <gallery>
 File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink
 </gallery>
-!! result
+!! html
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/InterWikiLink"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/InterWikiLink"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
@@ -16807,11 +17045,11 @@ File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink
 
 !!test
 Gallery override link with absolute external link (bug 34852)
 
 !!test
 Gallery override link with absolute external link (bug 34852)
-!! input
+!! wikitext
 <gallery>
 File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
 </gallery>
 <gallery>
 File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
 </gallery>
-!! result
+!! html
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
@@ -16826,11 +17064,11 @@ File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
 
 !!test
 Gallery override link with malicious javascript (bug 34852)
 
 !!test
 Gallery override link with malicious javascript (bug 34852)
-!! input
+!! wikitext
 <gallery>
 File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!');
 </gallery>
 <gallery>
 File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!');
 </gallery>
-!! result
+!! html
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/%22_onclick%3D%22alert(%27malicious_javascript_code!%27);"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/%22_onclick%3D%22alert(%27malicious_javascript_code!%27);"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
@@ -16845,11 +17083,11 @@ File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascri
 
 !!test
 Gallery with invalid title as link (bug 43964)
 
 !!test
 Gallery with invalid title as link (bug 43964)
-!! input
+!! wikitext
 <gallery>
 File:foobar.jpg|link=<
 </gallery>
 <gallery>
 File:foobar.jpg|link=<
 </gallery>
-!! result
+!! html
 <ul class="gallery mw-gallery-traditional">
                <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="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
 <ul class="gallery mw-gallery-traditional">
                <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="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
@@ -16862,19 +17100,19 @@ File:foobar.jpg|link=<
 
 !!test
 Language parser function
 
 !!test
 Language parser function
-!! input
+!! wikitext
 {{#language:ar}}
 {{#language:ar}}
-!! result
+!! html
 <p>العربية
 </p>
 !! end
 
 !!test
 Padleft and padright as substr
 <p>العربية
 </p>
 !! end
 
 !!test
 Padleft and padright as substr
-!! input
+!! wikitext
 {{padleft:|3|abcde}}
 {{padright:|3|abcde}}
 {{padleft:|3|abcde}}
 {{padright:|3|abcde}}
-!! result
+!! html
 <p>abc
 abc
 </p>
 <p>abc
 abc
 </p>
@@ -16882,11 +17120,11 @@ abc
 
 !!test
 Special parser function
 
 !!test
 Special parser function
-!! input
+!! wikitext
 {{#special:RandomPage}}
 {{#special:BaDtItLe}}
 {{#special:Foobar}}
 {{#special:RandomPage}}
 {{#special:BaDtItLe}}
 {{#special:Foobar}}
-!! result
+!! html
 <p>Special:Random
 Special:Badtitle
 Special:Foobar
 <p>Special:Random
 Special:Badtitle
 Special:Foobar
@@ -16895,27 +17133,27 @@ Special:Foobar
 
 !!test
 Bug 34939 - Case insensitive link parsing ([HttP://])
 
 !!test
 Bug 34939 - Case insensitive link parsing ([HttP://])
-!! input
+!! wikitext
 [HttP://MediaWiki.Org/]
 [HttP://MediaWiki.Org/]
-!! result
+!! html
 <p><a rel="nofollow" class="external autonumber" href="HttP://MediaWiki.Org/">[1]</a>
 </p>
 !! end
 
 !!test
 Bug 34939 - Case insensitive link parsing ([HttP:// title])
 <p><a rel="nofollow" class="external autonumber" href="HttP://MediaWiki.Org/">[1]</a>
 </p>
 !! end
 
 !!test
 Bug 34939 - Case insensitive link parsing ([HttP:// title])
-!! input
+!! wikitext
 [HttP://MediaWiki.Org/ MediaWiki]
 [HttP://MediaWiki.Org/ MediaWiki]
-!! result
+!! html
 <p><a rel="nofollow" class="external text" href="HttP://MediaWiki.Org/">MediaWiki</a>
 </p>
 !! end
 
 !!test
 Bug 34939 - Case insensitive link parsing (HttP://)
 <p><a rel="nofollow" class="external text" href="HttP://MediaWiki.Org/">MediaWiki</a>
 </p>
 !! end
 
 !!test
 Bug 34939 - Case insensitive link parsing (HttP://)
-!! input
+!! wikitext
 HttP://MediaWiki.Org/
 HttP://MediaWiki.Org/
-!! result
+!! html
 <p><a rel="nofollow" class="external free" href="HttP://MediaWiki.Org/">HttP://MediaWiki.Org/</a>
 </p>
 !! end
 <p><a rel="nofollow" class="external free" href="HttP://MediaWiki.Org/">HttP://MediaWiki.Org/</a>
 </p>
 !! end
@@ -16924,14 +17162,14 @@ HttP://MediaWiki.Org/
 Disable TOC
 !! options
 notoc
 Disable TOC
 !! options
 notoc
-!! input
+!! wikitext
 Lead
 == Section 1 ==
 == Section 2 ==
 == Section 3 ==
 == Section 4 ==
 == Section 5 ==
 Lead
 == Section 1 ==
 == Section 2 ==
 == Section 3 ==
 == Section 4 ==
 == Section 5 ==
-!! result
+!! html
 <p>Lead
 </p>
 
 <p>Lead
 </p>
 
@@ -16952,11 +17190,11 @@ Lead
 1. SOL-sensitive wikitext tokens as template-args
 !!options
 parsoid=wt2html,wt2wt
 1. SOL-sensitive wikitext tokens as template-args
 !!options
 parsoid=wt2html,wt2wt
-!!input
+!! wikitext
 {{echo|*a}}
 {{echo|#a}}
 {{echo|:a}}
 {{echo|*a}}
 {{echo|#a}}
 {{echo|:a}}
-!!result
+!! html
 <span about="#mwt1" typeof="mw:Transclusion">
 </span><ul about="#mwt1"><li>a</li>
 </ul>
 <span about="#mwt1" typeof="mw:Transclusion">
 </span><ul about="#mwt1"><li>a</li>
 </ul>
@@ -16978,11 +17216,11 @@ parsoid=wt2html,wt2wt
 Ref: 1. ref-location should be replaced with an index span
 !!options
 parsoid
 Ref: 1. ref-location should be replaced with an index span
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref>foo</ref>
 B <ref name="x">foo</ref>
 C <ref name="y" />
 A <ref>foo</ref>
 B <ref name="x">foo</ref>
 C <ref name="y" />
-!!result
+!! html
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span>
 B <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"x"}}' id="cite_ref-x-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-2">[2]</a></span>
 C <span about="#mwt3" class="reference" data-mw='{"name":"ref","attrs":{"name":"y"}}' id="cite_ref-y-3-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-y-3">[3]</a></span></p>
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span>
 B <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"x"}}' id="cite_ref-x-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-2">[2]</a></span>
 C <span about="#mwt3" class="reference" data-mw='{"name":"ref","attrs":{"name":"y"}}' id="cite_ref-y-3-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-y-3">[3]</a></span></p>
@@ -16992,10 +17230,10 @@ C <span about="#mwt3" class="reference" data-mw='{"name":"ref","attrs":{"name":"
 Ref: 2. ref-tags with identical names should all get the same index
 !!options
 parsoid
 Ref: 2. ref-tags with identical names should all get the same index
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref name="x">foo</ref>
 B <ref name="x" />
 A <ref name="x">foo</ref>
 B <ref name="x" />
-!!result
+!! html
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"x"}}' id="cite_ref-x-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span>
 B <span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{"name":"x"}}' id="cite_ref-x-1-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span></p>
 !!end
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"x"}}' id="cite_ref-x-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span>
 B <span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{"name":"x"}}' id="cite_ref-x-1-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span></p>
 !!end
@@ -17004,11 +17242,11 @@ B <span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{"name":"
 Ref: 3. spaces in ref-names should be ignored
 !!options
 parsoid
 Ref: 3. spaces in ref-names should be ignored
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref name="x">foo</ref>
 B <ref name=" x " />
 C <ref name= x  />
 A <ref name="x">foo</ref>
 B <ref name=" x " />
 C <ref name= x  />
-!!result
+!! html
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"x"}}' id="cite_ref-x-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span>
 B <span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{"name":"x"}}' id="cite_ref-x-1-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span>
 C <span about="#mwt3" class="reference" data-mw='{"name":"ref","attrs":{"name":"x"}}' id="cite_ref-x-1-2" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span></p>
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"x"}}' id="cite_ref-x-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span>
 B <span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{"name":"x"}}' id="cite_ref-x-1-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span>
 C <span about="#mwt3" class="reference" data-mw='{"name":"ref","attrs":{"name":"x"}}' id="cite_ref-x-1-2" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span></p>
@@ -17019,9 +17257,9 @@ Ref: 4. 'constructor' should be accepted as a valid ref-name
 (NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly)
 !!options
 parsoid
 (NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly)
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref name="constructor">foo</ref>
 A <ref name="constructor">foo</ref>
-!!result
+!! html
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"constructor"}}' id="cite_ref-constructor-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-constructor-1">[1]</a></span></p>
 !!end
 
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"constructor"}}' id="cite_ref-constructor-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-constructor-1">[1]</a></span></p>
 !!end
 
@@ -17029,17 +17267,17 @@ A <ref name="constructor">foo</ref>
 Ref: 5. body should accept generic wikitext
 !!options
 parsoid
 Ref: 5. body should accept generic wikitext
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref>
  This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}
 </ref>
 
 <references />
 A <ref>
  This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}
 </ref>
 
 <references />
-!!result
-<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"This is a &lt;b data-parsoid=&#39;{\"dsr\":[19,40,3,3]}&#39;>&lt;a rel=\"mw:WikiLink\" href=\"./Bolded_link\" data-parsoid=&#39;{\"stx\":\"simple\",\"a\":{\"href\":\"./Bolded_link\"},\"sa\":{\"href\":\"bolded link\"},\"dsr\":[22,37,2,2]}&#39;>bolded link&lt;/a>&lt;/b> and this is a &lt;span about=\"#mwt5\" typeof=\"mw:Transclusion\" data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"transclusion\"}},\"i\":0}}]}&#39; data-parsoid=&#39;{\"dsr\":[55,76,null,null],\"pi\":[[{\"k\":\"1\",\"spc\":[\"\",\"\",\"\",\"\"]}]]}&#39;>transclusion&lt;/span>\n"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
+!! html
+<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"This is a &lt;b data-parsoid=&#39;{\"dsr\":[19,40,3,3]}&#39;>&lt;a rel=\"mw:WikiLink\" href=\"./Bolded_link\" data-parsoid=&#39;{\"stx\":\"simple\",\"a\":{\"href\":\"./Bolded_link\"},\"sa\":{\"href\":\"bolded link\"},\"dsr\":[22,37,2,2]}&#39;>bolded link&lt;/a>&lt;/b> and this is a &lt;span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"transclusion\"}},\"i\":0}}]}&#39; data-parsoid=&#39;{\"dsr\":[55,76,null,null],\"pi\":[[{\"k\":\"1\",\"spc\":[\"\",\"\",\"\",\"\"]}]]}&#39;>transclusion&lt;/span>\n"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
 
 <ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'>
 
 <ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'>
-<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> This is a <b><a rel="mw:WikiLink" href="./Bolded_link">bolded link</a></b> and this is a <span about="#mwt5" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}'>transclusion</span>
+<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> This is a <b><a rel="mw:WikiLink" href="./Bolded_link">bolded link</a></b> and this is a <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}'>transclusion</span>
 </li>
 </ol>
 !!end
 </li>
 </ol>
 !!end
@@ -17048,7 +17286,7 @@ A <ref>
 Ref: 6. indent-pres should not be output in ref-body
 !!options
 parsoid
 Ref: 6. indent-pres should not be output in ref-body
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref>
  foo
  bar
 A <ref>
  foo
  bar
@@ -17056,7 +17294,7 @@ A <ref>
 </ref>
 
 <references />
 </ref>
 
 <references />
-!!result
+!! html
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo\n bar\n baz\n"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
 
 <ol class="references" typeof="mw:Extension/references" about="#mwt3" data-mw='{"name":"references","attrs":{}}'>
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo\n bar\n baz\n"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
 
 <ol class="references" typeof="mw:Extension/references" about="#mwt3" data-mw='{"name":"references","attrs":{}}'>
@@ -17071,7 +17309,7 @@ A <ref>
 Ref: 7. No p-wrapping in ref-body
 !!options
 parsoid
 Ref: 7. No p-wrapping in ref-body
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref>
 foo
 
 A <ref>
 foo
 
@@ -17086,7 +17324,7 @@ booz
 </ref>
 
 <references />
 </ref>
 
 <references />
-!!result
+!! html
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo\n\nbar\n\n\nbaz\n\n\n\nbooz\n"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
 
 <ol about="#mwt2" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'>
 <p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo\n\nbar\n\n\nbaz\n\n\n\nbooz\n"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
 
 <ol about="#mwt2" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'>
@@ -17108,11 +17346,11 @@ booz
 Ref: 8. transclusion wikitext has lower precedence
 !!options
 parsoid
 Ref: 8. transclusion wikitext has lower precedence
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref> foo {{echo|</ref> B C}}
 
 <references />
 A <ref> foo {{echo|</ref> B C}}
 
 <references />
-!!result
+!! html
 <p>A <span class="reference" data-mw="{&quot;name&quot;:&quot;ref&quot;,&quot;body&quot;:{&quot;html&quot;:&quot;foo <span typeof=\&quot;mw:Nowiki\&quot; data-parsoid='{\&quot;src\&quot;:\&quot;{{\&quot;,\&quot;dsr\&quot;:[12,14,0,0]}'>{{</span>echo|&quot;},&quot;attrs&quot;:{}}" id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> B C<span typeof="mw:Nowiki">}}</span></p>
 <ol class="references" typeof="mw:Extension/references" data-mw="{&quot;name&quot;:&quot;references&quot;,&quot;attrs&quot;:{}}">
 <li id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo <span typeof="mw:Nowiki">{{</span>echo|</li>
 <p>A <span class="reference" data-mw="{&quot;name&quot;:&quot;ref&quot;,&quot;body&quot;:{&quot;html&quot;:&quot;foo <span typeof=\&quot;mw:Nowiki\&quot; data-parsoid='{\&quot;src\&quot;:\&quot;{{\&quot;,\&quot;dsr\&quot;:[12,14,0,0]}'>{{</span>echo|&quot;},&quot;attrs&quot;:{}}" id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> B C<span typeof="mw:Nowiki">}}</span></p>
 <ol class="references" typeof="mw:Extension/references" data-mw="{&quot;name&quot;:&quot;references&quot;,&quot;attrs&quot;:{}}">
 <li id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo <span typeof="mw:Nowiki">{{</span>echo|</li>
@@ -17123,10 +17361,10 @@ A <ref> foo {{echo|</ref> B C}}
 Ref: 9. unclosed comments should not leak out of ref-body
 !!options
 parsoid
 Ref: 9. unclosed comments should not leak out of ref-body
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref> foo <!--</ref> B C
 <references />
 A <ref> foo <!--</ref> B C
 <references />
-!!result
+!! html
 <p>A <span class="reference" data-mw='{"name":"ref","body":{"html":"foo &lt;!---->"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> B C</p>
 <ol class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'>
 <li id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo </li>
 <p>A <span class="reference" data-mw='{"name":"ref","body":{"html":"foo &lt;!---->"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> B C</p>
 <ol class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'>
 <li id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo </li>
@@ -17137,16 +17375,16 @@ A <ref> foo <!--</ref> B C
 Ref: 10. Unclosed HTML tags should not leak out of ref-body
 !!options
 parsoid
 Ref: 10. Unclosed HTML tags should not leak out of ref-body
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref> <b> foo </ref> B C
 
 <references />
 A <ref> <b> foo </ref> B C
 
 <references />
-!!result
-<p data-parsoid='{"dsr":[0,26,0,0]}'>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"&lt;b data-parsoid=&#39;{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[8,16,3,0]}&#39;> foo &lt;/b>"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref> &lt;b> foo &lt;/ref>","dsr":[2,22,5,6]}'><a href="#cite_note-1">[1]</a></span> B C</p>
+!! html
+<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"&lt;b data-parsoid=&#39;{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[8,16,3,0]}&#39;> foo &lt;/b>"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref> &lt;b> foo &lt;/ref>"}'><a href="#cite_note-1">[1]</a></span> B C</p>
 
 
 
 
-<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-parsoid='{"src":"&lt;references />","dsr":[28,42,2,2]}' data-mw='{"name":"references","attrs":{}}'>
-<li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> <b data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[8,16,3,0]}'> foo </b></li>
+<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-parsoid='{"src":"&lt;references />"}' data-mw='{"name":"references","attrs":{}}'>
+<li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> <b data-parsoid='{"stx":"html","autoInsertedEnd":true}'> foo </b></li>
 </ol>
 !!end
 
 </ol>
 !!end
 
@@ -17154,26 +17392,26 @@ A <ref> <b> foo </ref> B C
 Ref: 11. ref-tags acts like an inline element wrt P-wrapping
 !!options
 parsoid
 Ref: 11. ref-tags acts like an inline element wrt P-wrapping
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref>foo</ref> B
 C <ref>bar</ref> D
 A <ref>foo</ref> B
 C <ref>bar</ref> D
-!!result
-<p data-parsoid='{"dsr":[0,37,0,0]}'>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref>foo&lt;/ref>","dsr":[2,16,5,6]}'><a href="#cite_note-1">[1]</a></span> B
-C <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref>bar&lt;/ref>","dsr":[21,35,5,6]}'><a href="#cite_note-2">[2]</a></span> D</p>
+!! html
+<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref>foo&lt;/ref>"}'><a href="#cite_note-1">[1]</a></span> B
+C <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref>bar&lt;/ref>"}'><a href="#cite_note-2">[2]</a></span> D</p>
 !!end
 
 !!test
 Ref: 12. ref-tags act as trailing newline migration barrier
 !!options
 parsoid
 !!end
 
 !!test
 Ref: 12. ref-tags act as trailing newline migration barrier
 !!options
 parsoid
-!!input
+!! wikitext
 <!--the newline at the end of this line moves out of the p-tag-->a
 
 b<!--the newline at the end of this line stays inside the p-tag--> <ref />
 <ref />
 
 c
 <!--the newline at the end of this line moves out of the p-tag-->a
 
 b<!--the newline at the end of this line stays inside the p-tag--> <ref />
 <ref />
 
 c
-!!result
+!! html
 <p><!--the newline at the end of this line moves out of the p-tag-->a</p>
 
 
 <p><!--the newline at the end of this line moves out of the p-tag-->a</p>
 
 
 Ref: 13. ref-tags are not SOL-transparent and block indent-pres
 !!options
 parsoid
 Ref: 13. ref-tags are not SOL-transparent and block indent-pres
 !!options
 parsoid
-!!input
+!! wikitext
 <ref>foo</ref> A
 <ref>bar
 </ref> B
 <ref>foo</ref> A
 <ref>bar
 </ref> B
-!!result
+!! html
 <p><span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> A
 <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"bar\n"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-2">[2]</a></span> B</p>
 !!end
 <p><span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> A
 <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"bar\n"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-2">[2]</a></span> B</p>
 !!end
@@ -17201,14 +17439,14 @@ parsoid
 Ref: 14. A nested ref-tag should be emitted as plain text
 !!options
 parsoid
 Ref: 14. A nested ref-tag should be emitted as plain text
 !!options
 parsoid
-!!input
+!! wikitext
 <ref>foo <ref>bar</ref> baz</ref>
 
 <references />
 <ref>foo <ref>bar</ref> baz</ref>
 
 <references />
-!!result
-<p data-parsoid='{"dsr":[0,33,0,0]}'><span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo &amp;lt;ref>bar&amp;lt;/ref> baz"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref>foo &lt;ref>bar&lt;/ref> baz&lt;/ref>","dsr":[0,33,5,6]}'><a href="#cite_note-1">[1]</a></span></p>
+!! html
+<p><span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo &amp;lt;ref>bar&amp;lt;/ref> baz"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref>foo &lt;ref>bar&lt;/ref> baz&lt;/ref>"}'><a href="#cite_note-1">[1]</a></span></p>
 
 
-<ol class="references" typeof="mw:Extension/references" about="#mwt5" data-parsoid='{"src":"&lt;references />","dsr":[35,49,2,2]}' data-mw='{"name":"references","attrs":{}}'>
+<ol class="references" typeof="mw:Extension/references" about="#mwt5" data-parsoid='{"src":"&lt;references />"}' data-mw='{"name":"references","attrs":{}}'>
 <li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo &lt;ref>bar&lt;/ref> baz</li>
 </ol>
 !!end
 <li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo &lt;ref>bar&lt;/ref> baz</li>
 </ol>
 !!end
@@ -17217,12 +17455,12 @@ parsoid
 Ref: 15. ref-tags with identical names should get identical indexes
 !!options
 parsoid
 Ref: 15. ref-tags with identical names should get identical indexes
 !!options
 parsoid
-!!input
+!! wikitext
 A1 <ref name="a">foo</ref> A2 <ref name="a" />
 B1 <ref name="b" /> B2 <ref name="b">bar</ref>
 
 <references />
 A1 <ref name="a">foo</ref> A2 <ref name="a" />
 B1 <ref name="b" /> B2 <ref name="b">bar</ref>
 
 <references />
-!!result
+!! html
 <p>A1 <span about="#mwt3" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"a"}}' id="cite_ref-a-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-a-1">[1]</a></span> A2 <span about="#mwt4" class="reference" data-mw='{"name":"ref","attrs":{"name":"a"}}' id="cite_ref-a-1-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-a-1">[1]</a></span>
 B1 <span about="#mwt7" class="reference" data-mw='{"name":"ref","attrs":{"name":"b"}}' id="cite_ref-b-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-b-2">[2]</a></span> B2 <span about="#mwt8" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"name":"b"}}' id="cite_ref-b-2-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-b-2">[2]</a></span></p>
 
 <p>A1 <span about="#mwt3" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"a"}}' id="cite_ref-a-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-a-1">[1]</a></span> A2 <span about="#mwt4" class="reference" data-mw='{"name":"ref","attrs":{"name":"a"}}' id="cite_ref-a-1-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-a-1">[1]</a></span>
 B1 <span about="#mwt7" class="reference" data-mw='{"name":"ref","attrs":{"name":"b"}}' id="cite_ref-b-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-b-2">[2]</a></span> B2 <span about="#mwt8" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"name":"b"}}' id="cite_ref-b-2-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-b-2">[2]</a></span></p>
 
@@ -17235,11 +17473,11 @@ B1 <span about="#mwt7" class="reference" data-mw='{"name":"ref","attrs":{"name":
 Ref: 16. Tokenizer should accept non-standard whitespace in <ref> and </ref> tags
 !!options
 parsoid=wt2html
 Ref: 16. Tokenizer should accept non-standard whitespace in <ref> and </ref> tags
 !!options
 parsoid=wt2html
-!!input
+!! wikitext
 A <ref >foo</ref >
 
 <references />
 A <ref >foo</ref >
 
 <references />
-!!result
+!! html
 <p>A <span class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
 
 <ol class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'>
 <p>A <span class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
 
 <ol class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'>
@@ -17250,9 +17488,9 @@ A <ref >foo</ref >
 References: 1. references tag without any refs should be handled properly
 !!options
 parsoid
 References: 1. references tag without any refs should be handled properly
 !!options
 parsoid
-!!input
+!! wikitext
 <references />
 <references />
-!!result
+!! html
 <ol about="#mwt2" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'></ol>
 !!end
 
 <ol about="#mwt2" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'></ol>
 !!end
 
@@ -17260,14 +17498,14 @@ parsoid
 References: 2. references tag with group only outputs references from that group
 !!options
 parsoid
 References: 2. references tag with group only outputs references from that group
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref group="a">foo</ref>
 B <ref group="b">bar</ref>
 
 <references group="a" />
 A <ref group="a">foo</ref>
 B <ref group="b">bar</ref>
 
 <references group="a" />
-!!result
+!! html
 <p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"group":"a"}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[a 1]</a></span>
 <p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"group":"a"}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[a 1]</a></span>
-B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"group":"b"}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[b 1]</a></span></p>
+B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"group":"b"}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-2">[b 1]</a></span></p>
 
 <ol about="#mwt6" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{"group":"a"}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo</li>
 </ol>
 
 <ol about="#mwt6" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{"group":"a"}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo</li>
 </ol>
@@ -17277,7 +17515,7 @@ B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"b
 References: 3. ref list should be cleared after processing references
 !!options
 parsoid
 References: 3. ref list should be cleared after processing references
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref>foo</ref>
 
 <references />
 A <ref>foo</ref>
 
 <references />
@@ -17285,15 +17523,15 @@ A <ref>foo</ref>
 B <ref>bar</ref>
 
 <references />
 B <ref>bar</ref>
 
 <references />
-!!result
+!! html
 <p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
 
 <ol about="#mwt4" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo</li>
 </ol>
 
 <p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
 
 <ol about="#mwt4" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo</li>
 </ol>
 
-<p>B <span about="#mwt6" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p>
+<p>B <span about="#mwt6" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-2">[1]</a></span></p>
 
 
-<ol about="#mwt8" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> bar</li>
+<ol about="#mwt8" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2-0">↑</a></span> bar</li>
 </ol>
 !!end
 
 </ol>
 !!end
 
@@ -17301,7 +17539,7 @@ B <ref>bar</ref>
 References: 4. only referenced group should be cleared after processing references
 !!options
 parsoid
 References: 4. only referenced group should be cleared after processing references
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref group="a">afoo</ref>
 B <ref>bfoo</ref>
 
 A <ref group="a">afoo</ref>
 B <ref>bfoo</ref>
 
@@ -17310,16 +17548,16 @@ B <ref>bfoo</ref>
 C <ref>cfoo</ref>
 
 <references />
 C <ref>cfoo</ref>
 
 <references />
-!!result
+!! html
 <p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"afoo"},"attrs":{"group":"a"}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[a 1]</a></span>
 <p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"afoo"},"attrs":{"group":"a"}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[a 1]</a></span>
-B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bfoo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>bfoo</ref>","dsr":[30,45,5,6]}'><a href="#cite_note-1">[1]</a></span></p>
+B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bfoo"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>bfoo</ref>"}'><a href="#cite_note-2">[1]</a></span></p>
 
 <ol about="#mwt6" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{"group":"a"}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> afoo</li>
 </ol>
 
 
 <ol about="#mwt6" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{"group":"a"}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> afoo</li>
 </ol>
 
-<p>C <span about="#mwt8" class="reference" data-mw='{"name":"ref","body":{"html":"cfoo"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-2">[2]</a></span></p>
+<p>C <span about="#mwt8" class="reference" data-mw='{"name":"ref","body":{"html":"cfoo"},"attrs":{}}' id="cite_ref-3-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-3">[2]</a></span></p>
 
 
-<ol about="#mwt10" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> bfoo</li><li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2-0">↑</a></span> cfoo</li>
+<ol about="#mwt10" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2-0">↑</a></span> bfoo</li><li about="#cite_note-3" id="cite_note-3"><span rel="mw:referencedBy"><a href="#cite_ref-3-0">↑</a></span> cfoo</li>
 </ol>
 !!end
 
 </ol>
 !!end
 
@@ -17327,7 +17565,7 @@ B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"b
 References: 5. ref tags in references should be processed while ignoring all other content
 !!options
 parsoid
 References: 5. ref tags in references should be processed while ignoring all other content
 !!options
 parsoid
-!!input
+!! wikitext
 A <ref name="a" />
 B <ref name="b">bar</ref>
 
 A <ref name="a" />
 B <ref name="b">bar</ref>
 
@@ -17335,12 +17573,12 @@ B <ref name="b">bar</ref>
 <ref name="a">foo</ref>
 This should just get lost.
 </references>
 <ref name="a">foo</ref>
 This should just get lost.
 </references>
-!!result
-<p data-parsoid='{"dsr":[0,57,0,0]}'>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{"name":"a"}}' id="cite_ref-a-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref name=\"a\" />","dsr":[2,18,16,0]}'><a href="#cite_note-a-1">[1]</a></span>
-B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"name":"b"}}' id="cite_ref-b-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref name=\"b\">bar&lt;/ref>","dsr":[21,44,14,6]}'><a href="#cite_note-b-2">[2]</a></span></p>
+!! html
+<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{"name":"a"}}' id="cite_ref-a-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref name=\"a\" />"}'><a href="#cite_note-a-1">[1]</a></span>
+B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"name":"b"}}' id="cite_ref-b-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref name=\"b\">bar&lt;/ref>"}'><a href="#cite_note-b-2">[2]</a></span></p>
 
 
 
 
-<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-parsoid='{"src":"&lt;references>\n&lt;ref name=\"a\">foo&lt;/ref>\nThis should just get lost.\n&lt;/references>","dsr":[46,123,2,2]}' data-mw='{"name":"references","body":{"extsrc":"&lt;ref name=\"a\">foo&lt;/ref>\nThis should just get lost.","html":"\n&lt;span about=\"#mwt8\" class=\"reference\" data-mw=&#39;{\"name\":\"ref\",\"body\":{\"html\":\"foo\"},\"attrs\":{\"name\":\"a\"}}&#39; rel=\"dc:references\" typeof=\"mw:Extension/ref\">&lt;a href=\"#cite_note-a-1\">[1]&lt;/a>&lt;/span>\n"},"attrs":{}}'>
+<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-parsoid='{"src":"&lt;references>\n&lt;ref name=\"a\">foo&lt;/ref>\nThis should just get lost.\n&lt;/references>"}' data-mw='{"name":"references","body":{"extsrc":"&lt;ref name=\"a\">foo&lt;/ref>\nThis should just get lost.","html":"\n&lt;span about=\"#mwt8\" class=\"reference\" data-mw=&#39;{\"name\":\"ref\",\"body\":{\"html\":\"foo\"},\"attrs\":{\"name\":\"a\"}}&#39; rel=\"dc:references\" typeof=\"mw:Extension/ref\">&lt;a href=\"#cite_note-a-1\">[1]&lt;/a>&lt;/span>\n"},"attrs":{}}'>
 <li about="#cite_note-a-1" id="cite_note-a-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-a-1-0">↑</a></span> foo</li>
 <li about="#cite_note-b-2" id="cite_note-b-2" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-b-2-0">↑</a></span> bar</li>
 </ol>
 <li about="#cite_note-a-1" id="cite_note-a-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-a-1-0">↑</a></span> foo</li>
 <li about="#cite_note-b-2" id="cite_note-b-2" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-b-2-0">↑</a></span> bar</li>
 </ol>
@@ -17350,9 +17588,9 @@ B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"b
 References: 6. <references /> from a transclusion
 !!options
 parsoid
 References: 6. <references /> from a transclusion
 !!options
 parsoid
-!!input
+!! wikitext
 <ref>Foo</ref> {{echo|<references />}}
 <ref>Foo</ref> {{echo|<references />}}
-!!result
+!! html
 <span about="#mwt3" class="reference" data-mw='{"name":"ref","body":{"html":"Foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> <ol class="references" typeof="mw:Extension/references mw:Transclusion" about="#mwt4" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;references />"}},"i":0}}]}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> Foo</li></ol>
 !!end
 
 <span about="#mwt3" class="reference" data-mw='{"name":"ref","body":{"html":"Foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> <ol class="references" typeof="mw:Extension/references mw:Transclusion" about="#mwt4" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;references />"}},"i":0}}]}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> Foo</li></ol>
 !!end
 
@@ -17360,28 +17598,51 @@ parsoid
 References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled
 !! options
 parsoid
 References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled
 !! options
 parsoid
-!! input
+!! wikitext
 A <ref>foo bar for a</ref>
 A <ref>foo bar for a</ref>
-B <ref name="b" />
+B <ref group="X" name="b" />
 
 <references />
 
 
 <references />
 
-<references>
+<references group="X">
 <ref name="b">foo</ref>
 </references>
 <ref name="b">foo</ref>
 </references>
-!! result
-<p data-parsoid='{"dsr":[0,45,0,0]}'>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo bar for a"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref>foo bar for a&lt;/ref>","dsr":[2,26,5,6]}'><a href="#cite_note-1">[1]</a></span>
-B <span about="#mwt4" class="reference" data-mw='{"name":"ref","attrs":{"name":"b"}}' id="cite_ref-b-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref name=\"b\" />","dsr":[29,45,16,0]}'><a href="#cite_note-b-2">[2]</a></span></p>
+!! html
+<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo bar for a"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref>foo bar for a&lt;/ref>"}'><a href="#cite_note-2" data-parsoid="{}">[2]</a></span>
+B <span about="#mwt4" class="reference" data-mw='{"name":"ref","attrs":{"group":"X","name":"b"}}' id="cite_ref-b-3-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref name=\"b\" group=\"X\" />"}'><a href="#cite_note-b-3" data-parsoid="{}">[X 1]</a></span></p>
+
+<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-parsoid='{"src":"&lt;references />"}' data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-b-1" id="cite_note-b-1" data-parsoid="{}"><span rel="mw:referencedBy" data-parsoid="{}">↑</span> foo</li><li about="#cite_note-2" id="cite_note-2" data-parsoid="{}"><span rel="mw:referencedBy" data-parsoid="{}"><a href="#cite_ref-2-0" data-parsoid="{}">↑</a></span> foo bar for a</li></ol>
+
+<ol class="references" typeof="mw:Extension/references" about="#mwt8" data-parsoid='{"src":"&lt;references group=\"X\">\n&lt;ref name=\"b\">foo&lt;/ref>\n&lt;/references>","group":"X"}' data-mw='{"name":"references","body":{"extsrc":"&lt;ref name=\"b\">foo&lt;/ref>","html":"\n&lt;span about=\"#mwt10\" class=\"reference\" data-mw=&#39;{\"name\":\"ref\",\"body\":{\"html\":\"foo\"},\"attrs\":{\"name\":\"b\"}}&#39; rel=\"dc:references\" typeof=\"mw:Extension/ref\">&lt;a href=\"#cite_note-b-1\">[1]&lt;/a>&lt;/span>\n"},"attrs":{"group":"X"}}'><li about="#cite_note-b-3" id="cite_note-b-3" data-parsoid="{}"><span rel="mw:referencedBy" data-parsoid="{}"><a href="#cite_ref-b-3-0" data-parsoid="{}">↑</a></span> </li></ol>
+!! end
+
+# This test is wt2html only because we're permitting the serializer to produce
+# dirty diffs, normalizing the unclosed references to the self-closed version.
+!! test
+Generate references for unclosed references tag
+!! options
+parsoid=wt2html
+!! wikitext
+a<ref>foo</ref>
 
 
+<references>
+!! html
+<p data-parsoid='{}'>a<span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"&lt;ref>foo&lt;/ref>"}'><a href="#cite_note-1" data-parsoid="{}">[1]</a></span></p>
 
 
-<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-parsoid='{"src":"&lt;references />","dsr":[47,61,2,2]}' data-mw='{"name":"references","attrs":{}}'>
-<li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo bar for a</li>
-<li about="#cite_note-b-2" id="cite_note-b-2" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-b-2-0">↑</a></span> </li></ol>
 
 
+<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-parsoid='{"src":"&lt;references>"}' data-mw='{"name":"references","attrs":{}}'>
+<li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy" data-parsoid="{}"><a href="#cite_ref-1-0" data-parsoid="{}">↑</a></span> foo</li></ol>
+!! end
 
 
-<ol class="references" typeof="mw:Extension/references" about="#mwt8" data-parsoid='{"src":"&lt;references>\n&lt;ref name=\"b\">foo&lt;/ref>\n&lt;/references>","dsr":[63,113,2,2]}' data-mw='{"name":"references","body":{"extsrc":"&lt;ref name=\"b\">foo&lt;/ref>","html":"\n&lt;span about=\"#mwt10\" class=\"reference\" data-mw=&#39;{\"name\":\"ref\",\"body\":{\"html\":\"foo\"},\"attrs\":{\"name\":\"b\"}}&#39; rel=\"dc:references\" typeof=\"mw:Extension/ref\">&lt;a href=\"#cite_note-b-1\">[1]&lt;/a>&lt;/span>\n"},"attrs":{}}'>
-<li about="#cite_note-b-1" id="cite_note-b-1" data-parsoid="{}"><span rel="mw:referencedBy">↑</span> foo</li>
-</ol>
+!! test
+New reference serializes on its own line
+!! options
+parsoid=wt2wt,html2wt
+!! wikitext
+foo
+<references />
+!! html
+foo<ol class="references" typeof="mw:Extension/references" about="#mwt2" data-mw='{"name":"references","attrs":{}}'></ol>
 !! end
 
 #### ----------------------------------------------------------------
 !! end
 
 #### ----------------------------------------------------------------
@@ -17410,7 +17671,7 @@ B <span about="#mwt4" class="reference" data-mw='{"name":"ref","attrs":{"name":"
 Headings: 0. Unnested
 !! options
 parsoid
 Headings: 0. Unnested
 !! options
 parsoid
-!! input
+!! wikitext
 <nowiki>=foo=</nowiki>
 
 <nowiki> =foo= </nowiki>
 <nowiki>=foo=</nowiki>
 
 <nowiki> =foo= </nowiki>
@@ -17418,7 +17679,7 @@ parsoid
 <nowiki>=foo=</nowiki>
 
 =foo''a''<nowiki>=</nowiki>
 <nowiki>=foo=</nowiki>
 
 =foo''a''<nowiki>=</nowiki>
-!! result
+!! html
 <p><span typeof="mw:Nowiki">=foo=</span></p>
 
 <p><span typeof="mw:Nowiki"> =foo= </span>
 <p><span typeof="mw:Nowiki">=foo=</span></p>
 
 <p><span typeof="mw:Nowiki"> =foo= </span>
@@ -17433,7 +17694,7 @@ Headings: 1. Nested inside html
 (New headings and existing headings are handled differently)
 !! options
 parsoid=html2wt
 (New headings and existing headings are handled differently)
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 = =foo= =
 
 == =foo= ==
 = =foo= =
 
 == =foo= ==
@@ -17447,7 +17708,7 @@ parsoid=html2wt
 =====<nowiki>=foo=</nowiki>=====
 ======<nowiki>=foo=</nowiki>======
 
 =====<nowiki>=foo=</nowiki>=====
 ======<nowiki>=foo=</nowiki>======
 
-!! result
+!! html
 <h1>=foo=</h1>
 <h2>=foo=</h2>
 <h3>=foo=</h3>
 <h1>=foo=</h1>
 <h2>=foo=</h2>
 <h3>=foo=</h3>
@@ -17464,7 +17725,7 @@ parsoid=html2wt
 Headings: 2. Outside heading nest on a single line <h1>foo</h1>*bar
 !! options
 parsoid=html2wt
 Headings: 2. Outside heading nest on a single line <h1>foo</h1>*bar
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 = foo =
 <nowiki>*</nowiki>bar
 
 = foo =
 <nowiki>*</nowiki>bar
 
@@ -17473,7 +17734,7 @@ parsoid=html2wt
 
 = foo =
 <nowiki>=bar=</nowiki>
 
 = foo =
 <nowiki>=bar=</nowiki>
-!! result
+!! html
 <h1>foo</h1>*bar
 <h1>foo</h1>=bar
 <h1>foo</h1>=bar=
 <h1>foo</h1>*bar
 <h1>foo</h1>=bar
 <h1>foo</h1>=bar=
@@ -17483,9 +17744,9 @@ parsoid=html2wt
 Headings: 3. Nested inside html with wikitext split by html tags
 !! options
 parsoid=html2wt
 Headings: 3. Nested inside html with wikitext split by html tags
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 = ='''bold'''<nowiki>foo=</nowiki> =
 = ='''bold'''<nowiki>foo=</nowiki> =
-!! result
+!! html
 <h1>=<b>bold</b><span typeof="mw:Nowiki">foo=</span></h1>
 !!end
 
 <h1>=<b>bold</b><span typeof="mw:Nowiki">foo=</span></h1>
 !!end
 
@@ -17493,7 +17754,7 @@ parsoid=html2wt
 Headings: 4a. No escaping needed (testing just h1 and h2)
 !! options
 parsoid=html2wt
 Headings: 4a. No escaping needed (testing just h1 and h2)
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 = =foo =
 
 = foo= =
 = =foo =
 
 = foo= =
@@ -17509,7 +17770,7 @@ parsoid=html2wt
 = ''=''foo= =
 
 = <nowiki>=</nowiki> =
 = ''=''foo= =
 
 = <nowiki>=</nowiki> =
-!! result
+!! html
 <h1>=foo</h1>
 <h1>foo=</h1>
 <h1> =foo= </h1>
 <h1>=foo</h1>
 <h1>foo=</h1>
 <h1> =foo= </h1>
@@ -17524,11 +17785,11 @@ parsoid=html2wt
 Headings: 4b. No escaping needed (inside p-tags)
 !! options
 parsoid=html2wt
 Headings: 4b. No escaping needed (inside p-tags)
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 ===
 =foo= x
 =foo= <s></s>
 ===
 =foo= x
 =foo= <s></s>
-!! result
+!! html
 <p>===
 =foo= x
 =foo= <s></s>
 <p>===
 =foo= x
 =foo= <s></s>
@@ -17539,7 +17800,7 @@ parsoid=html2wt
 Headings: 5. Empty headings
 !! options
 parsoid
 Headings: 5. Empty headings
 !! options
 parsoid
-!! input
+!! wikitext
 =<nowiki/>=
 
 ==<nowiki/>==
 =<nowiki/>=
 
 ==<nowiki/>==
@@ -17551,7 +17812,7 @@ parsoid
 =====<nowiki/>=====
 
 ======<nowiki/>======
 =====<nowiki/>=====
 
 ======<nowiki/>======
-!! result
+!! html
 <h1></h1>
 <h2></h2>
 <h3></h3>
 <h1></h1>
 <h2></h2>
 <h3></h3>
@@ -17564,7 +17825,7 @@ parsoid
 Headings: 6a. Heading chars in SOL context (with trailing spaces)
 !! options
 parsoid
 Headings: 6a. Heading chars in SOL context (with trailing spaces)
 !! options
 parsoid
-!! input
+!! wikitext
 <nowiki>=a=</nowiki>
 
 <nowiki>=a=</nowiki> 
 <nowiki>=a=</nowiki>
 
 <nowiki>=a=</nowiki> 
@@ -17572,7 +17833,7 @@ parsoid
 <nowiki>=a=</nowiki>   
 
 <nowiki>=a=</nowiki>   
 <nowiki>=a=</nowiki>   
 
 <nowiki>=a=</nowiki>   
-!! result
+!! html
 <p>=a=</p>
 <p>=a= </p>
 <p>=a= </p>
 <p>=a=</p>
 <p>=a= </p>
 <p>=a= </p>
@@ -17583,7 +17844,7 @@ parsoid
 Headings: 6b. Heading chars in SOL context (with trailing newlines)
 !! options
 parsoid
 Headings: 6b. Heading chars in SOL context (with trailing newlines)
 !! options
 parsoid
-!! input
+!! wikitext
 <nowiki>=a=
 b</nowiki>
 
 <nowiki>=a=
 b</nowiki>
 
@@ -17595,7 +17856,7 @@ b</nowiki>
 
 <nowiki>=a=     
 b</nowiki>
 
 <nowiki>=a=     
 b</nowiki>
-!! result
+!! html
 <p>=a=
 b</p>
 <p>=a= 
 <p>=a=
 b</p>
 <p>=a= 
@@ -17611,10 +17872,10 @@ b</p>
 Headings: 6c. Heading chars in SOL context (leading newline break)
 !! options
 parsoid
 Headings: 6c. Heading chars in SOL context (leading newline break)
 !! options
 parsoid
-!! input
+!! wikitext
 a
 <nowiki>=b=</nowiki>
 a
 <nowiki>=b=</nowiki>
-!! result
+!! html
 <p>a
 =b=</p>
 !!end
 <p>a
 =b=</p>
 !!end
 Headings: 6d. Heading chars in SOL context (with interspersed comments)
 !! options
 parsoid
 Headings: 6d. Heading chars in SOL context (with interspersed comments)
 !! options
 parsoid
-!! input
+!! wikitext
 <!--c0--><nowiki>=a=</nowiki>
 
 <!--c1--><nowiki>=a=</nowiki> <!--c2-->         <!--c3-->
 <!--c0--><nowiki>=a=</nowiki>
 
 <!--c1--><nowiki>=a=</nowiki> <!--c2-->         <!--c3-->
-!! result
+!! html
 <p><!--c0-->=a=</p>
 <p><!--c1-->=a= <!--c2-->       <!--c3--></p>
 !!end
 <p><!--c0-->=a=</p>
 <p><!--c1-->=a= <!--c2-->       <!--c3--></p>
 !!end
@@ -17636,9 +17897,9 @@ parsoid
 Headings: 6d. Heading chars in SOL context (No escaping needed)
 !! options
 parsoid=html2wt
 Headings: 6d. Heading chars in SOL context (No escaping needed)
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 =a=<div>b</div>
 =a=<div>b</div>
-!! result
+!! html
 =a=<div>b</div>
 !!end
 
 =a=<div>b</div>
 !!end
 
@@ -17655,11 +17916,11 @@ parsoid=html2wt
 
 !! test
 Lists: 0. Outside nests
 
 !! test
 Lists: 0. Outside nests
-!! input
+!! wikitext
 <nowiki>*</nowiki>foo
 
 <nowiki>#</nowiki>foo
 <nowiki>*</nowiki>foo
 
 <nowiki>#</nowiki>foo
-!! result
+!! html
 <p>*foo
 </p><p>#foo
 </p>
 <p>*foo
 </p><p>#foo
 </p>
@@ -17667,7 +17928,7 @@ Lists: 0. Outside nests
 
 !! test
 Lists: 1. Nested inside html
 
 !! test
 Lists: 1. Nested inside html
-!! input
+!! wikitext
 *<nowiki>*foo</nowiki>
 
 *<nowiki>#foo</nowiki>
 *<nowiki>*foo</nowiki>
 
 *<nowiki>#foo</nowiki>
@@ -17683,7 +17944,7 @@ Lists: 1. Nested inside html
 #<nowiki>:foo</nowiki>
 
 #<nowiki>;foo</nowiki>
 #<nowiki>:foo</nowiki>
 
 #<nowiki>;foo</nowiki>
-!! result
+!! html
 <ul>
 <li>*foo
 </li>
 <ul>
 <li>*foo
 </li>
@@ -17721,7 +17982,7 @@ Lists: 1. Nested inside html
 
 !! test
 Lists: 2. Inside definition lists
 
 !! test
 Lists: 2. Inside definition lists
-!! input
+!! wikitext
 ;<nowiki>;foo</nowiki>
 
 ;<nowiki>:foo</nowiki>
 ;<nowiki>;foo</nowiki>
 
 ;<nowiki>:foo</nowiki>
@@ -17730,7 +17991,7 @@ Lists: 2. Inside definition lists
 :bar
 
 :<nowiki>:foo</nowiki>
 :bar
 
 :<nowiki>:foo</nowiki>
-!! result
+!! html
 <dl>
 <dt>;foo
 </dt>
 <dl>
 <dt>;foo
 </dt>
@@ -17754,11 +18015,11 @@ Lists: 2. Inside definition lists
 
 !! test
 Lists: 3. Only bullets at start of text should be escaped
 
 !! test
 Lists: 3. Only bullets at start of text should be escaped
-!! input
+!! wikitext
 *<nowiki>*foo*bar</nowiki>
 
 *<nowiki>*foo</nowiki>''it''*bar
 *<nowiki>*foo*bar</nowiki>
 
 *<nowiki>*foo</nowiki>''it''*bar
-!! result
+!! html
 <ul>
 <li>*foo*bar
 </li>
 <ul>
 <li>*foo*bar
 </li>
@@ -17774,7 +18035,7 @@ Lists: 3. Only bullets at start of text should be escaped
 Lists: 4. No escapes needed
 !! options
 parsoid
 Lists: 4. No escapes needed
 !! options
 parsoid
-!! input
+!! wikitext
 *foo*bar
 
 *''foo''*bar
 *foo*bar
 
 *''foo''*bar
@@ -17782,7 +18043,7 @@ parsoid
 *[[Foo]]: bar
 
 *[[Foo]]*bar
 *[[Foo]]: bar
 
 *[[Foo]]*bar
-!! result
+!! html
 <ul>
 <li>foo*bar
 </li>
 <ul>
 <li>foo*bar
 </li>
@@ -17803,7 +18064,7 @@ parsoid
 
 !! test
 Lists: 5. No unnecessary escapes
 
 !! test
 Lists: 5. No unnecessary escapes
-!! input
+!! wikitext
 * bar <span><nowiki>[[foo]]</nowiki></span>
 
 *=bar <span><nowiki>[[foo]]</nowiki></span>
 * bar <span><nowiki>[[foo]]</nowiki></span>
 
 *=bar <span><nowiki>[[foo]]</nowiki></span>
@@ -17815,7 +18076,7 @@ Lists: 5. No unnecessary escapes
 *=bar <span>foo]]</span>=
 
 * <s></s>: a
 *=bar <span>foo]]</span>=
 
 * <s></s>: a
-!! result
+!! html
 <ul>
 <li> bar <span>[[foo]]</span>
 </li>
 <ul>
 <li> bar <span>[[foo]]</span>
 </li>
@@ -17847,18 +18108,18 @@ Lists: 5. No unnecessary escapes
 Lists: 6. Escape bullets in SOL position
 !! options
 parsoid
 Lists: 6. Escape bullets in SOL position
 !! options
 parsoid
-!! input
+!! wikitext
 <!--cmt--><nowiki>*foo</nowiki>
 <!--cmt--><nowiki>*foo</nowiki>
-!! result
+!! html
 <p><!--cmt--><span typeof="mw:Nowiki">*foo</span></p>
 !!end
 
 !! test
 Lists: 7. Escape bullets in a multi-line context
 <p><!--cmt--><span typeof="mw:Nowiki">*foo</span></p>
 !!end
 
 !! test
 Lists: 7. Escape bullets in a multi-line context
-!! input
+!! wikitext
 a
 <nowiki>*</nowiki>b
 a
 <nowiki>*</nowiki>b
-!! result
+!! html
 <p>a
 *b
 </p>
 <p>a
 *b
 </p>
 HRs: 1. Single line
 !! options
 parsoid
 HRs: 1. Single line
 !! options
 parsoid
-!! input
+!! wikitext
 ----<nowiki>----</nowiki>
 ----=foo=
 ----*foo
 ----<nowiki>----</nowiki>
 ----=foo=
 ----*foo
-!! result
+!! html
 <hr><span typeof="mw:Nowiki">----</span>
 <hr>=foo=
 <hr>*foo
 <hr><span typeof="mw:Nowiki">----</span>
 <hr>=foo=
 <hr>*foo
@@ -17903,10 +18164,10 @@ parsoid
 
 !! test
 Tables: 1a. Simple example
 
 !! test
 Tables: 1a. Simple example
-!! input
+!! wikitext
 <nowiki>{|
 |}</nowiki>
 <nowiki>{|
 |}</nowiki>
-!! result
+!! html
 <p>{|
 |}
 </p>
 <p>{|
 |}
 </p>
@@ -17914,27 +18175,27 @@ Tables: 1a. Simple example
 
 !! test
 Tables: 1b. No escaping needed
 
 !! test
 Tables: 1b. No escaping needed
-!! input
+!! wikitext
 !foo
 !foo
-!! result
+!! html
 <p>!foo
 </p>
 !! end
 
 !! test
 Tables: 1c. No escaping needed
 <p>!foo
 </p>
 !! end
 
 !! test
 Tables: 1c. No escaping needed
-!! input
+!! wikitext
 |foo
 |foo
-!! result
+!! html
 <p>|foo
 </p>
 !! end
 
 !! test
 Tables: 1d. No escaping needed
 <p>|foo
 </p>
 !! end
 
 !! test
 Tables: 1d. No escaping needed
-!! input
+!! wikitext
 |}foo
 |}foo
-!! result
+!! html
 <p>|}foo
 </p>
 !! end
 <p>|}foo
 </p>
 !! end
@@ -17943,13 +18204,13 @@ Tables: 1d. No escaping needed
 Tables: 2a. Nested in td
 !! options
 parsoid=html2wt
 Tables: 2a. Nested in td
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 {|
 |<nowiki>foo|bar</nowiki>
 |-
 |x<div><nowiki>a|b</nowiki></div>
 |}
 {|
 |<nowiki>foo|bar</nowiki>
 |-
 |x<div><nowiki>a|b</nowiki></div>
 |}
-!! result
+!! html
 <table><tbody><tr>
 <td>foo|bar</td></tr>
 <tr><td>x<div>a|b</div></td>
 <table><tbody><tr>
 <td>foo|bar</td></tr>
 <tr><td>x<div>a|b</div></td>
@@ -17960,12 +18221,12 @@ parsoid=html2wt
 Tables: 2b. Nested in td
 !! options
 parsoid
 Tables: 2b. Nested in td
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 |<nowiki>foo||bar</nowiki>
 |''it''<nowiki>foo||bar</nowiki>
 |}
 {|
 |<nowiki>foo||bar</nowiki>
 |''it''<nowiki>foo||bar</nowiki>
 |}
-!! result
+!! html
 <table><tbody><tr>
 <td><span typeof="mw:Nowiki">foo||bar</span></td>
 <td><i>it</i><span typeof="mw:Nowiki">foo||bar</span></td></tr></tbody></table>
 <table><tbody><tr>
 <td><span typeof="mw:Nowiki">foo||bar</span></td>
 <td><i>it</i><span typeof="mw:Nowiki">foo||bar</span></td></tr></tbody></table>
@@ -17975,11 +18236,11 @@ parsoid
 Tables: 2c. Nested in td -- no escaping needed
 !! options
 parsoid
 Tables: 2c. Nested in td -- no escaping needed
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 |foo!!bar
 |}
 {|
 |foo!!bar
 |}
-!! result
+!! html
 <table><tbody><tr><td>foo!!bar
 </td></tr></tbody></table>
 
 <table><tbody><tr><td>foo!!bar
 </td></tr></tbody></table>
 
@@ -17989,11 +18250,11 @@ parsoid
 Tables: 3a. Nested in th
 !! options
 parsoid
 Tables: 3a. Nested in th
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 !foo!bar
 |}
 {|
 !foo!bar
 |}
-!! result
+!! html
 <table><tbody><tr><th>foo!bar
 </th></tr></tbody></table>
 
 <table><tbody><tr><th>foo!bar
 </th></tr></tbody></table>
 
@@ -18003,11 +18264,11 @@ parsoid
 Tables: 3b. Nested in th
 !! options
 parsoid
 Tables: 3b. Nested in th
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 !<nowiki>foo!!bar</nowiki>
 |}
 {|
 !<nowiki>foo!!bar</nowiki>
 |}
-!! result
+!! html
 <table>
 <tbody><tr><th><span typeof="mw:Nowiki">foo!!bar</span></th></tr>
 </tbody></table>
 <table>
 <tbody><tr><th><span typeof="mw:Nowiki">foo!!bar</span></th></tr>
 </tbody></table>
@@ -18017,11 +18278,11 @@ parsoid
 Tables: 3c. Nested in th -- no escaping needed
 !! options
 parsoid
 Tables: 3c. Nested in th -- no escaping needed
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 !<nowiki>foo||bar</nowiki>
 |}
 {|
 !<nowiki>foo||bar</nowiki>
 |}
-!! result
+!! html
 <table><tbody><tr>
 <th><span typeof="mw:Nowiki">foo||bar</span></th></tr></tbody></table>
 !! end
 <table><tbody><tr>
 <th><span typeof="mw:Nowiki">foo||bar</span></th></tr></tbody></table>
 !! end
@@ -18030,13 +18291,13 @@ parsoid
 Tables: 4a. Escape -
 !! options
 parsoid
 Tables: 4a. Escape -
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 !-bar
 |-
 |<nowiki>-bar</nowiki>
 |}
 {|
 !-bar
 |-
 |<nowiki>-bar</nowiki>
 |}
-!! result
+!! html
 <table><tbody>
 <tr><th>-bar</th></tr>
 <tr>
 <table><tbody>
 <tr><th>-bar</th></tr>
 <tr>
@@ -18047,13 +18308,13 @@ parsoid
 Tables: 4b. Escape +
 !! options
 parsoid
 Tables: 4b. Escape +
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 !+bar
 |-
 |<nowiki>+bar</nowiki>
 |}
 {|
 !+bar
 |-
 |<nowiki>+bar</nowiki>
 |}
-!! result
+!! html
 <table><tbody>
 <tr><th>+bar</th></tr>
 <tr>
 <table><tbody>
 <tr><th>+bar</th></tr>
 <tr>
@@ -18064,7 +18325,7 @@ parsoid
 Tables: 4c. No escaping needed
 !! options
 parsoid
 Tables: 4c. No escaping needed
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 |foo-bar
 |foo+bar
 {|
 |foo-bar
 |foo+bar
@@ -18080,7 +18341,7 @@ bar|baz
 |x
 <div>a|b</div>
 |}
 |x
 <div>a|b</div>
 |}
-!! result
+!! html
 <table><tbody>
 <tr><td>foo-bar</td><td>foo+bar</td></tr>
 <tr><td><i>foo</i>-bar</td><td><i>foo</i>+bar</td></tr>
 <table><tbody>
 <tr><td>foo-bar</td><td>foo+bar</td></tr>
 <tr><td><i>foo</i>-bar</td><td><i>foo</i>+bar</td></tr>
@@ -18097,13 +18358,13 @@ bar|baz
 Tables: 4d. No escaping needed
 !! options
 parsoid
 Tables: 4d. No escaping needed
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 |[[Foo]]-bar
 ||+1
 ||-2
 |}
 {|
 |[[Foo]]-bar
 ||+1
 ||-2
 |}
-!! result
+!! html
 <table>
 <tbody><tr><td><a rel="mw:WikiLink" href="./Foo">Foo</a>-bar</td>
 <td data-parsoid='{"startTagSrc":"|","attrSepSrc":"|"}'>+1</td>
 <table>
 <tbody><tr><td><a rel="mw:WikiLink" href="./Foo">Foo</a>-bar</td>
 <td data-parsoid='{"startTagSrc":"|","attrSepSrc":"|"}'>+1</td>
@@ -18111,6 +18372,23 @@ parsoid
 </tbody></table>
 !! end
 
 </tbody></table>
 !! end
 
+!! test
+Tables: Digest broken attributes on table and tr tag
+!! options
+parsoid=wt2html
+!! wikitext
+{| || |} ++
+|- || || ++ --
+|- > [
+|}
+!! html
+<table>
+<tbody>
+<tr></tr>
+<tr></tr>
+</tbody></table>
+!! end
+
 #### --------------- Links ----------------
 #### 1. Quote marks in link text
 #### 2. Wikilinks: Escapes needed
 #### --------------- Links ----------------
 #### 1. Quote marks in link text
 #### 2. Wikilinks: Escapes needed
@@ -18122,9 +18400,9 @@ parsoid
 Links 1. Quote marks in link text
 !! options
 parsoid
 Links 1. Quote marks in link text
 !! options
 parsoid
-!! input
+!! wikitext
 [[Foo|Foo<nowiki>''boo''</nowiki>]]
 [[Foo|Foo<nowiki>''boo''</nowiki>]]
-!! result
+!! html
 <a rel="mw:WikiLink" href="Foo">Foo''boo''</a>
 !! end
 
 <a rel="mw:WikiLink" href="Foo">Foo''boo''</a>
 !! end
 
@@ -18132,18 +18410,20 @@ parsoid
 Links 2. WikiLinks: Escapes needed
 !! options
 parsoid
 Links 2. WikiLinks: Escapes needed
 !! options
 parsoid
-!! input
-[[Foo|<nowiki>[Foobar]</nowiki>]]
+!! wikitext
+[[Foo|[Foobar]]]
 [[Foo|<nowiki>Foobar]</nowiki>]]
 [[Foo|x [Foobar] x]]
 [[Foo|<nowiki>Foobar]</nowiki>]]
 [[Foo|x [Foobar] x]]
-[[Foo|<nowiki>x [http://google.com g] x</nowiki>]]
+[[Foo|x <nowiki>[http://google.com g]</nowiki> x]]
 [[Foo|<nowiki>[[Bar]]</nowiki>]]
 [[Foo|<nowiki>x [[Bar]] x</nowiki>]]
 [[Foo|<nowiki>|Bar</nowiki>]]
 [[Foo|<nowiki>]]bar</nowiki>]]
 [[Foo|<nowiki>[[bar</nowiki>]]
 [[Foo|<nowiki>[[Bar]]</nowiki>]]
 [[Foo|<nowiki>x [[Bar]] x</nowiki>]]
 [[Foo|<nowiki>|Bar</nowiki>]]
 [[Foo|<nowiki>]]bar</nowiki>]]
 [[Foo|<nowiki>[[bar</nowiki>]]
+[[Foo|<nowiki>x [[ y</nowiki>]]
+[[Foo|<nowiki>x ]] y</nowiki>]]
 [[Foo|<nowiki>x ]] y [[ z</nowiki>]]
 [[Foo|<nowiki>x ]] y [[ z</nowiki>]]
-!! result
+!! html
 <a href="Foo" rel="mw:WikiLink">[Foobar]</a>
 <a href="Foo" rel="mw:WikiLink">Foobar]</a>
 <a href="Foo" rel="mw:WikiLink">x [Foobar] x</a>
 <a href="Foo" rel="mw:WikiLink">[Foobar]</a>
 <a href="Foo" rel="mw:WikiLink">Foobar]</a>
 <a href="Foo" rel="mw:WikiLink">x [Foobar] x</a>
@@ -18153,6 +18433,8 @@ parsoid
 <a href="Foo" rel="mw:WikiLink">|Bar</a>
 <a href="Foo" rel="mw:WikiLink">]]bar</a>
 <a href="Foo" rel="mw:WikiLink">[[bar</a>
 <a href="Foo" rel="mw:WikiLink">|Bar</a>
 <a href="Foo" rel="mw:WikiLink">]]bar</a>
 <a href="Foo" rel="mw:WikiLink">[[bar</a>
+<a href="Foo" rel="mw:WikiLink">x [[ y</a>
+<a href="Foo" rel="mw:WikiLink">x ]] y</a>
 <a href="Foo" rel="mw:WikiLink">x ]] y [[ z</a>
 !! end
 
 <a href="Foo" rel="mw:WikiLink">x ]] y [[ z</a>
 !! end
 
@@ -18160,10 +18442,10 @@ parsoid
 Links 3. WikiLinks: No escapes needed
 !! options
 parsoid
 Links 3. WikiLinks: No escapes needed
 !! options
 parsoid
-!! input
+!! wikitext
 [[Foo|[Foobar]]
 [[Foo|foo|bar]]
 [[Foo|[Foobar]]
 [[Foo|foo|bar]]
-!! result
+!! html
 <a href="Foo" rel="mw:WikiLink">[Foobar</a>
 <a href="Foo" rel="mw:WikiLink">foo|bar</a>
 !! end
 <a href="Foo" rel="mw:WikiLink">[Foobar</a>
 <a href="Foo" rel="mw:WikiLink">foo|bar</a>
 !! end
@@ -18172,7 +18454,7 @@ parsoid
 Links 4. ExtLinks: Escapes needed
 !! options
 parsoid
 Links 4. ExtLinks: Escapes needed
 !! options
 parsoid
-!! input
+!! wikitext
 [http://google.com <nowiki>[google]</nowiki>]
 [http://google.com <nowiki>google]</nowiki>]
 
 [http://google.com <nowiki>[google]</nowiki>]
 [http://google.com <nowiki>google]</nowiki>]
 
@@ -18180,7 +18462,7 @@ parsoid
 
 <nowiki>[http://google.com google]</nowiki>
 
 
 <nowiki>[http://google.com google]</nowiki>
 
-!! result
+!! html
 <p><a href="http://google.com" rel="mw:ExtLink">[google]</a>
 <a href="http://google.com" rel="mw:ExtLink">google]</a></p>
 <p>[http://google.com]</p>
 <p><a href="http://google.com" rel="mw:ExtLink">[google]</a>
 <a href="http://google.com" rel="mw:ExtLink">google]</a></p>
 <p>[http://google.com]</p>
@@ -18191,9 +18473,9 @@ parsoid
 Links 5. ExtLinks: No escapes needed
 !! options
 parsoid
 Links 5. ExtLinks: No escapes needed
 !! options
 parsoid
-!! input
+!! wikitext
 [http://google.com [google]
 [http://google.com [google]
-!! result
+!! html
 <a href="http://google.com" rel="mw:ExtLink">[google</a>
 !! end
 
 <a href="http://google.com" rel="mw:ExtLink">[google</a>
 !! end
 
@@ -18207,7 +18489,7 @@ parsoid
 1. Quotes inside <b> and <i>
 !! options
 parsoid=html2wt,wt2wt
 1. Quotes inside <b> and <i>
 !! options
 parsoid=html2wt,wt2wt
-!! input
+!! wikitext
 ''<nowiki>'foo'</nowiki>''
 ''<nowiki>''foo''</nowiki>''
 ''<nowiki>'''foo'''</nowiki>''
 ''<nowiki>'foo'</nowiki>''
 ''<nowiki>''foo''</nowiki>''
 ''<nowiki>'''foo'''</nowiki>''
@@ -18225,7 +18507,7 @@ parsoid=html2wt,wt2wt
 '<nowiki/>'''foo'''<nowiki/>'
 ''fools'<span> errand</span>''
 ''<span>fool</span>'s errand''
 '<nowiki/>'''foo'''<nowiki/>'
 ''fools'<span> errand</span>''
 ''<span>fool</span>'s errand''
-!! result
+!! html
 <p><i>'foo'</i>
 <i>''foo''</i>
 <i>'''foo'''</i>
 <p><i>'foo'</i>
 <i>''foo''</i>
 <i>'''foo'''</i>
@@ -18247,11 +18529,11 @@ parsoid=html2wt,wt2wt
 
 !! test
 2. Link fragments separated by <i> and <b> tags
 
 !! test
 2. Link fragments separated by <i> and <b> tags
-!! input
+!! wikitext
 [[''foo''<nowiki>hello]]</nowiki>
 
 [['''foo'''<nowiki>hello]]</nowiki>
 [[''foo''<nowiki>hello]]</nowiki>
 
 [['''foo'''<nowiki>hello]]</nowiki>
-!! result
+!! html
 <p>[[<i>foo</i>hello]]
 </p><p>[[<b>foo</b>hello]]
 </p>
 <p>[[<i>foo</i>hello]]
 </p><p>[[<b>foo</b>hello]]
 </p>
@@ -18261,11 +18543,11 @@ parsoid=html2wt,wt2wt
 3. Link fragments inside <i> and <b>
 (FIXME: Escaping one or both of [[ and ]] is also acceptable --
  this is one of the shortcomings of this format)
 3. Link fragments inside <i> and <b>
 (FIXME: Escaping one or both of [[ and ]] is also acceptable --
  this is one of the shortcomings of this format)
-!! input
+!! wikitext
 ''[[foo''<nowiki>]]</nowiki>
 
 '''[[foo'''<nowiki>]]</nowiki>
 ''[[foo''<nowiki>]]</nowiki>
 
 '''[[foo'''<nowiki>]]</nowiki>
-!! result
+!! html
 <p><i>[[foo</i>]]
 </p><p><b>[[foo</b>]]
 </p>
 <p><i>[[foo</i>]]
 </p><p><b>[[foo</b>]]
 </p>
@@ -18273,10 +18555,10 @@ parsoid=html2wt,wt2wt
 
 !! test
 4. No escaping needed
 
 !! test
 4. No escaping needed
-!! input
+!! wikitext
 '<span>''bar''</span>'
 '<span>'''bar'''</span>'
 '<span>''bar''</span>'
 '<span>'''bar'''</span>'
-!! result
+!! html
 <p>'<span><i>bar</i></span>'
 '<span><b>bar</b></span>'
 </p>
 <p>'<span><i>bar</i></span>'
 '<span><b>bar</b></span>'
 </p>
@@ -18288,7 +18570,7 @@ parsoid=html2wt,wt2wt
 
 !! test
 1. No unnecessary escapes
 
 !! test
 1. No unnecessary escapes
-!! input
+!! wikitext
 bar <span><nowiki>[[foo]]</nowiki></span>
 
 =bar <span><nowiki>[[foo]]</nowiki></span>
 bar <span><nowiki>[[foo]]</nowiki></span>
 
 =bar <span><nowiki>[[foo]]</nowiki></span>
@@ -18298,7 +18580,7 @@ bar <span><nowiki>[[foo]]</nowiki></span>
 ]]bar <span><nowiki>[[foo]]</nowiki></span>
 
 =bar <span>foo]]</span><nowiki>=</nowiki>
 ]]bar <span><nowiki>[[foo]]</nowiki></span>
 
 =bar <span>foo]]</span><nowiki>=</nowiki>
-!! result
+!! html
 <p>bar <span>[[foo]]</span>
 </p><p>=bar <span>[[foo]]</span>
 </p><p>[[bar <span>[[foo]]</span>
 <p>bar <span>[[foo]]</span>
 </p><p>=bar <span>[[foo]]</span>
 </p><p>[[bar <span>[[foo]]</span>
@@ -18314,7 +18596,7 @@ bar <span><nowiki>[[foo]]</nowiki></span>
 1. Leading whitespace in SOL context should be escaped
 !! options
 parsoid
 1. Leading whitespace in SOL context should be escaped
 !! options
 parsoid
-!! input
+!! wikitext
 <nowiki> </nowiki>a
 
 <nowiki> </nowiki> a
 <nowiki> </nowiki>a
 
 <nowiki> </nowiki> a
 
 a
 <nowiki>       </nowiki> b
 
 a
 <nowiki>       </nowiki> b
-!! result
+!! html
 <p> a</p>
 <p>  a</p>
 <p>    a(tab)</p>
 <p> a</p>
 <p>  a</p>
 <p>    a(tab)</p>
 1. Valid behavior switches should be escaped
 !! options
 parsoid=html2wt
 1. Valid behavior switches should be escaped
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 <nowiki>__TOC__</nowiki>
 <nowiki>__TOC__</nowiki>
-!! result
+!! html
 __TOC__
 !! end
 
 __TOC__
 !! end
 
@@ -18362,10 +18644,10 @@ __TOC__
 2. Invalid behavior switches should not be escaped
 !! options
 parsoid=html2wt
 2. Invalid behavior switches should not be escaped
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 __TOO__
 __|__
 __TOO__
 __|__
-!! result
+!! html
 __TOO__
 __|__
 !! end
 __TOO__
 __|__
 !! end
@@ -18380,18 +18662,18 @@ __|__
 1. a tags
 !! options
 parsoid
 1. a tags
 !! options
 parsoid
-!! input
+!! wikitext
 <a href="http://google.com">google</a>
 <a href="http://google.com">google</a>
-!! result
+!! html
 &lt;a href=&quot;http://google.com&quot;&gt;google&lt;/a&gt;
 !! end
 
 !! test
 2. other tags
 &lt;a href=&quot;http://google.com&quot;&gt;google&lt;/a&gt;
 !! end
 
 !! test
 2. other tags
-!! input
+!! wikitext
 <nowiki><div>foo</div>
 <div style="color:red">foo</div></nowiki>
 <nowiki><div>foo</div>
 <div style="color:red">foo</div></nowiki>
-!! result
+!! html
 <p>&lt;div&gt;foo&lt;/div&gt;
 &lt;div style=&quot;color:red&quot;&gt;foo&lt;/div&gt;
 </p>
 <p>&lt;div&gt;foo&lt;/div&gt;
 &lt;div style=&quot;color:red&quot;&gt;foo&lt;/div&gt;
 </p>
@@ -18399,11 +18681,11 @@ parsoid
 
 !! test
 3. multi-line html tag
 
 !! test
 3. multi-line html tag
-!! input
+!! wikitext
 <nowiki><div
 >foo</div
 ></nowiki>
 <nowiki><div
 >foo</div
 ></nowiki>
-!! result
+!! html
 <p>&lt;div
 &gt;foo&lt;/div
 &gt;
 <p>&lt;div
 &gt;foo&lt;/div
 &gt;
@@ -18412,13 +18694,13 @@ parsoid
 
 !! test
 4. extension tags
 
 !! test
 4. extension tags
-!! input
+!! wikitext
 <nowiki><ref>foo</ref></nowiki>
 
 <nowiki><ref>bar</nowiki>
 
 baz<nowiki></ref></nowiki>
 <nowiki><ref>foo</ref></nowiki>
 
 <nowiki><ref>bar</nowiki>
 
 baz<nowiki></ref></nowiki>
-!! result
+!! html
 <p>&lt;ref&gt;foo&lt;/ref&gt;
 </p><p>&lt;ref&gt;bar
 </p><p>baz&lt;/ref&gt;
 <p>&lt;ref&gt;foo&lt;/ref&gt;
 </p><p>&lt;ref&gt;bar
 </p><p>baz&lt;/ref&gt;
@@ -18428,9 +18710,9 @@ baz<nowiki></ref></nowiki>
 #### --------------- Others ---------------
 !! test
 Escaping nowikis
 #### --------------- Others ---------------
 !! test
 Escaping nowikis
-!! input
+!! wikitext
 &lt;nowiki&gt;foo&lt;/nowiki&gt;
 &lt;nowiki&gt;foo&lt;/nowiki&gt;
-!! result
+!! html
 <p>&lt;nowiki&gt;foo&lt;/nowiki&gt;
 </p>
 !! end
 <p>&lt;nowiki&gt;foo&lt;/nowiki&gt;
 </p>
 !! end
@@ -18440,16 +18722,16 @@ Escaping nowikis
 (Bug 52035) Nowiki-escaping should not get tripped by " :" in text
 !! options
 parsoid=wt2wt,html2wt
 (Bug 52035) Nowiki-escaping should not get tripped by " :" in text
 !! options
 parsoid=wt2wt,html2wt
-!! input
+!! wikitext
 foo's bar :
 foo's bar :
-!! result
+!! html
 <p>foo's bar :</p>
 !! end
 
 !! test
 
 Tag-like HTML structures are passed through as text
 <p>foo's bar :</p>
 !! end
 
 !! test
 
 Tag-like HTML structures are passed through as text
-!! input
+!! wikitext
 <x y>
 
 <x.y>
 <x y>
 
 <x.y>
@@ -18463,7 +18745,7 @@ x<y
 a>b
 
 1<d e>f
 a>b
 
 1<d e>f
-!! result
+!! html
 <p>&lt;x y&gt;
 </p><p>&lt;x.y&gt;
 </p><p>&lt;x-y&gt;
 <p>&lt;x y&gt;
 </p><p>&lt;x.y&gt;
 </p><p>&lt;x-y&gt;
@@ -18479,36 +18761,36 @@ a>b
 # https://bugzilla.wikimedia.org/show_bug.cgi?id=17663)
 !! test
 Tag names followed by punctuation should not be recognized as tags
 # https://bugzilla.wikimedia.org/show_bug.cgi?id=17663)
 !! test
 Tag names followed by punctuation should not be recognized as tags
-!! input
+!! wikitext
 <s.ome> text
 <s.ome> text
-!! result
+!! html
 <p>&lt;s.ome&gt; text
 </p>
 !! end
 
 !! test
 HTML tag with necessary entities in attributes
 <p>&lt;s.ome&gt; text
 </p>
 !! end
 
 !! test
 HTML tag with necessary entities in attributes
-!! input
+!! wikitext
 <span title="&amp;amp;">foo</span>
 <span title="&amp;amp;">foo</span>
-!! result
+!! html
 <p><span title="&amp;amp;">foo</span>
 </p>
 !! end
 
 !! test
 HTML tag with 'unnecessary' entity encoding in attributes
 <p><span title="&amp;amp;">foo</span>
 </p>
 !! end
 
 !! test
 HTML tag with 'unnecessary' entity encoding in attributes
-!! input
+!! wikitext
 <span title="&amp;">foo</span>
 <span title="&amp;">foo</span>
-!! result
+!! html
 <p><span title="&amp;">foo</span>
 </p>
 !! end
 
 !! test
 HTML tag with broken attribute value quoting
 <p><span title="&amp;">foo</span>
 </p>
 !! end
 
 !! test
 HTML tag with broken attribute value quoting
-!! input
+!! wikitext
 <span title="Hello world>Foo</span>
 <span title="Hello world>Foo</span>
-!! result
+!! html
 <p><span>Foo</span>
 </p>
 !! end
 <p><span>Foo</span>
 </p>
 !! end
@@ -18517,20 +18799,20 @@ HTML tag with broken attribute value quoting
 Parsoid-only: HTML tag with broken attribute value quoting
 !! options
 parsoid
 Parsoid-only: HTML tag with broken attribute value quoting
 !! options
 parsoid
-!! input
+!! wikitext
 <span title="Hello world>Foo</span>
 <span title="Hello world>Foo</span>
-!! result
+!! html
 <p><span title="Hello world">Foo</span>
 </p>
 !! end
 
 !! test
 Table with broken attribute value quoting
 <p><span title="Hello world">Foo</span>
 </p>
 !! end
 
 !! test
 Table with broken attribute value quoting
-!! input
+!! wikitext
 {|
 | title="Hello world|Foo
 |}
 {|
 | title="Hello world|Foo
 |}
-!! result
+!! html
 <table>
 <tr>
 <td>Foo
 <table>
 <tr>
 <td>Foo
@@ -18540,12 +18822,12 @@ Table with broken attribute value quoting
 
 !! test
 Table with broken attribute value quoting on consecutive lines
 
 !! test
 Table with broken attribute value quoting on consecutive lines
-!! input
+!! wikitext
 {|
 | title="Hello world|Foo
 | style="color:red|Bar
 |}
 {|
 | title="Hello world|Foo
 | style="color:red|Bar
 |}
-!! result
+!! html
 <table>
 <tr>
 <td>Foo
 <table>
 <tr>
 <td>Foo
@@ -18559,12 +18841,12 @@ Table with broken attribute value quoting on consecutive lines
 Parsoid-only: Table with broken attribute value quoting on consecutive lines
 !! options
 parsoid
 Parsoid-only: Table with broken attribute value quoting on consecutive lines
 !! options
 parsoid
-!! input
+!! wikitext
 {|
 | title="Hello world|Foo
 | style="color:red|Bar
 |}
 {|
 | title="Hello world|Foo
 | style="color:red|Bar
 |}
-!! result
+!! html
 <table><tbody>
 <tr>
 <td title="Hello world">Foo
 <table><tbody>
 <tr>
 <td title="Hello world">Foo
@@ -18577,9 +18859,9 @@ parsoid
 Parsoid-only: Don't wrap broken template tags in <nowiki> on wt2wt (Bug 42353)
 !! options
 parsoid
 Parsoid-only: Don't wrap broken template tags in <nowiki> on wt2wt (Bug 42353)
 !! options
 parsoid
-!! input
+!! wikitext
 {{}}
 {{}}
-!! result
+!! html
 {{}}
 !! end
 
 {{}}
 !! end
 
@@ -18587,19 +18869,19 @@ parsoid
 Parsoid-only: Don't wrap broken template tags in <nowiki> on wt2wt (Bug 42353)
 !! options
 parsoid
 Parsoid-only: Don't wrap broken template tags in <nowiki> on wt2wt (Bug 42353)
 !! options
 parsoid
-!! input
+!! wikitext
 }}{{
 }}{{
-!! result
+!! html
 }}{{
 !! end
 
 !!test
 Accept empty td cell attribute
 }}{{
 !! end
 
 !!test
 Accept empty td cell attribute
-!!input
+!! wikitext
 {|
 | align="center" | foo ||  |
 |}
 {|
 | align="center" | foo ||  |
 |}
-!!result
+!! html
 <table>
 <tr>
 <td align="center"> foo </td>
 <table>
 <tr>
 <td align="center"> foo </td>
@@ -18610,11 +18892,11 @@ Accept empty td cell attribute
 
 !!test
 Non-empty attributes in th-cells
 
 !!test
 Non-empty attributes in th-cells
-!!input
+!! wikitext
 {|
 ! Foo !! style="color: red" | Bar
 |}
 {|
 ! Foo !! style="color: red" | Bar
 |}
-!!result
+!! html
 <table>
 <tr>
 <th> Foo </th>
 <table>
 <tr>
 <th> Foo </th>
@@ -18625,11 +18907,11 @@ Non-empty attributes in th-cells
 
 !!test
 Accept empty attributes in th-cells
 
 !!test
 Accept empty attributes in th-cells
-!!input
+!! wikitext
 {|
 !| foo !!| bar
 |}
 {|
 !| foo !!| bar
 |}
-!!result
+!! html
 <table>
 <tr>
 <th> foo </th>
 <table>
 <tr>
 <th> foo </th>
@@ -18640,14 +18922,14 @@ Accept empty attributes in th-cells
 
 !!test
 Empty table rows go away
 
 !!test
 Empty table rows go away
-!!input
+!! wikitext
 {|
 | Hello
 | there
 |- class="foo"
 |-
 |}
 {|
 | Hello
 | there
 |- class="foo"
 |-
 |}
-!! result
+!! html
 <table>
 <tr>
 <td> Hello
 <table>
 <tr>
 <td> Hello
@@ -18667,11 +18949,11 @@ Empty table rows go away
 
 !!test
 RT-ed inter-element separators should be valid separators
 
 !!test
 RT-ed inter-element separators should be valid separators
-!!input
+!! wikitext
 {|
 |- [[foo]]
 |}
 {|
 |- [[foo]]
 |}
-!!result
+!! html
 <table>
 
 </table>
 <table>
 
 </table>
@@ -18683,7 +18965,7 @@ Trailing newlines in a deep dom-subtree that ends a wikitext line should be migr
 (Parsoid-only since PHP parser relies on Tidy for correct output)
 !!options
 parsoid
 (Parsoid-only since PHP parser relies on Tidy for correct output)
 !!options
 parsoid
-!!input
+!! wikitext
 {|
 |<small>foo
 bar
 {|
 |<small>foo
 bar
@@ -18692,18 +18974,18 @@ bar
 {|
 |<small>foo<small>
 |}
 {|
 |<small>foo<small>
 |}
-!!result
+!! html
 !!end
 
 !!test
 Empty TD followed by TD with tpl-generated attribute
 !!end
 
 !!test
 Empty TD followed by TD with tpl-generated attribute
-!!input
+!! wikitext
 {|
 |-
 |
 |{{echo|style='color:red'}}|foo
 |}
 {|
 |-
 |
 |{{echo|style='color:red'}}|foo
 |}
-!!result
+!! html
 <table>
 
 <tr>
 <table>
 
 <tr>
@@ -18716,13 +18998,13 @@ Empty TD followed by TD with tpl-generated attribute
 
 !!test
 Indented table with an empty td
 
 !!test
 Indented table with an empty td
-!!input
+!! wikitext
  {|
  |-
  |
  |foo
  |}
  {|
  |-
  |
  |foo
  |}
-!!result
+!! html
 <table>
 
 <tr>
 <table>
 
 <tr>
@@ -18738,12 +19020,12 @@ Empty TR followed by a template-generated TR
 (Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext)
 !!options
 parsoid
 (Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext)
 !!options
 parsoid
-!!input
+!! wikitext
 {|
 |-
 {{echo|<tr><td>foo</td></tr>}}
 |}
 {|
 |-
 {{echo|<tr><td>foo</td></tr>}}
 |}
-!!result
+!! html
 <table>
 <tbody>
 <tr></tr>
 <table>
 <tbody>
 <tr></tr>
@@ -18758,14 +19040,14 @@ parsoid
 Empty TR followed by mixed-ws-comment line should RT correctly
 !!options
 parsoid
 Empty TR followed by mixed-ws-comment line should RT correctly
 !!options
 parsoid
-!!input
+!! wikitext
 {|
 |-
  <!--c-->
 |-
 <!--c--> <!--d-->
 |}
 {|
 |-
  <!--c-->
 |-
 <!--c--> <!--d-->
 |}
-!!result
+!! html
 <table>
 <tbody>
 <tr></tr>
 <table>
 <tbody>
 <tr></tr>
@@ -18780,10 +19062,10 @@ parsoid
 Multi-line image caption generated by templates with/without trailing newlines
 !!options
 parsoid
 Multi-line image caption generated by templates with/without trailing newlines
 !!options
 parsoid
-!!input
+!! wikitext
 [[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]]
 [[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]]
 [[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]]
 [[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]]
-!!result
+!! html
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&amp;wpDestFile=Foo.jpg" class="new" title="File:Foo.jpg">File:Foo.jpg</a>  <div class="thumbcaption">foo\nA\nB\nC</div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&amp;wpDestFile=Foo.jpg" class="new" title="File:Foo.jpg">File:Foo.jpg</a>  <div class="thumbcaption">foo\nA\nB\nC\n\n</div></div></div>
 
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&amp;wpDestFile=Foo.jpg" class="new" title="File:Foo.jpg">File:Foo.jpg</a>  <div class="thumbcaption">foo\nA\nB\nC</div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&amp;wpDestFile=Foo.jpg" class="new" title="File:Foo.jpg">File:Foo.jpg</a>  <div class="thumbcaption">foo\nA\nB\nC\n\n</div></div></div>
 
@@ -18795,10 +19077,10 @@ parsoid
 Improperly nested inline or quotes tags with whitespace in between
 !!options
 parsoid
 Improperly nested inline or quotes tags with whitespace in between
 !!options
 parsoid
-!!input
+!! wikitext
 <span> <s>x</span> </s>
 ''' ''x''' ''
 <span> <s>x</span> </s>
 ''' ''x''' ''
-!!result
+!! html
 <p><span> <s>x</s></span><s> </s>
 <b> <i>x</i></b><i> </i>
 </p>
 <p><span> <s>x</s></span><s> </s>
 <b> <i>x</i></b><i> </i>
 </p>
@@ -18808,9 +19090,9 @@ parsoid
 Encapsulate protected attributes from wt
 !!options
 parsoid
 Encapsulate protected attributes from wt
 !!options
 parsoid
-!!input
+!! wikitext
 <div typeof="mw:placeholder stuff" data-parsoid="weird" data-parsoid-other="no" about="time" rel="mw:true">foo</div>
 <div typeof="mw:placeholder stuff" data-parsoid="weird" data-parsoid-other="no" about="time" rel="mw:true">foo</div>
-!!result
+!! html
 <body><div data-x-typeof="mw:placeholder stuff" data-x-data-parsoid="weird" data-x-data-parsoid-other="no" data-x-about="time" data-x-rel="mw:true">foo</div>
 </body>
 !!end
 <body><div data-x-typeof="mw:placeholder stuff" data-x-data-parsoid="weird" data-x-data-parsoid-other="no" data-x-about="time" data-x-rel="mw:true">foo</div>
 </body>
 !!end
@@ -18822,32 +19104,50 @@ parsoid
 Ensure ParagraphWrapper can deal with stray closing pre tags
 !!options
 parsoid=wt2html
 Ensure ParagraphWrapper can deal with stray closing pre tags
 !!options
 parsoid=wt2html
-!!input
+!! wikitext
 plain text</pre>
 plain text</pre>
-!!result
+!! html
 plain text
 !!end
 
 !!test
 plain text
 !!end
 
 !!test
-Ensure fostered text content is wrapped in spans
+1. Ensure fostered text content is wrapped in spans
 !!options
 parsoid=wt2html
 !!options
 parsoid=wt2html
-!!input
+!! wikitext
 <table>hi</table><table>ho</table>
 <table>hi</table><table>ho</table>
-!!result
+!! html
 <span>hi</span>
 <table></table>
 <span>ho</span>
 <table></table>
 !!end
 
 <span>hi</span>
 <table></table>
 <span>ho</span>
 <table></table>
 !!end
 
+!!test
+2. Ensure fostered text content is wrapped in spans (traps regressions around fostered marker on the span getting lost)
+!!options
+parsoid=wt2html,wt2wt
+!! wikitext
+<table>
+<tr> || ||
+<td> a
+</table>
+!! html
+<span> || ||</span>
+<table>
+<tbody>
+<tr>
+<td> a</td></tr>
+</tbody></table>
+!!end
+
 !!test
 Encapsulation properly handles null DSR information from foster box
 !!options
 parsoid=wt2html,wt2wt
 !!test
 Encapsulation properly handles null DSR information from foster box
 !!options
 parsoid=wt2html,wt2wt
-!!input
+!! wikitext
 {{echo|<table>foo<tr><td>bar</td></tr></table>}}
 {{echo|<table>foo<tr><td>bar</td></tr></table>}}
-!!result
+!! html
 <span typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;
 <table>foo
 <tr>
 <span typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;
 <table>foo
 <tr>
@@ -18862,9 +19162,9 @@ parsoid=wt2html,wt2wt
 1. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
 1. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
-!!input
+!! wikitext
 <table>{{echo|foo<tr><td>bar</td></tr>}}</table>
 <table>{{echo|foo<tr><td>bar</td></tr>}}</table>
-!!result
+!! html
 <span typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>&quot;,{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;foo
 <tr>
 <span typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>&quot;,{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;foo
 <tr>
@@ -18879,9 +19179,9 @@ parsoid=wt2wt,wt2html
 2. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
 2. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
-!!input
+!! wikitext
 <table><div>{{echo|foo}}</div><tr><td>bar</td></tr></table>
 <table><div>{{echo|foo}}</div><tr><td>bar</td></tr></table>
-!!result
+!! html
 <div typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>
 <div>&quot;,{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;foo&quot;}},&quot;i&quot;:0}},&quot;</div>
 <div typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>
 <div>&quot;,{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;foo&quot;}},&quot;i&quot;:0}},&quot;</div>
@@ -18897,9 +19197,9 @@ parsoid=wt2wt,wt2html
 3. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
 3. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
-!!input
+!! wikitext
 <table><div><p>{{echo|foo</p></div><tr><td>}}bar</td></tr></table>
 <table><div><p>{{echo|foo</p></div><tr><td>}}bar</td></tr></table>
-!!result
+!! html
 <div typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>
 <div>
 <div typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>
 <div>
@@ -18917,9 +19217,9 @@ parsoid=wt2wt,wt2html
 4. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
 4. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
-!!input
+!! wikitext
 <table><div><p>{{echo|foo</p></div><tr><td>}}bar</td></tr></table>
 <table><div><p>{{echo|foo</p></div><tr><td>}}bar</td></tr></table>
-!!result
+!! html
 <div typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>
 <div>
 <div typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>
 <div>
@@ -18937,9 +19237,9 @@ parsoid=wt2wt,wt2html
 5. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
 5. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
-!!input
+!! wikitext
 <table><tr><td><div><p>{{echo|foo</p></div></td>foo}}</tr></table>
 <table><tr><td><div><p>{{echo|foo</p></div></td>foo}}</tr></table>
-!!result
+!! html
 <span typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>
 <tr>
 <span typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>
 <tr>
@@ -18958,9 +19258,9 @@ parsoid=wt2wt,wt2html
 6. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
 6. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
-!!input
+!! wikitext
 <table><tr><td><div><p>{{echo|foo</p></div></td>foo</tr></table>}}<p>ok</p>
 <table><tr><td><div><p>{{echo|foo</p></div></td>foo</tr></table>}}<p>ok</p>
-!!result
+!! html
 <span typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>
 <tr>
 <span typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>
 <tr>
@@ -18980,9 +19280,9 @@ parsoid=wt2wt,wt2html
 7. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
 7. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
-!!input
+!! wikitext
 <table>{{echo|<p>foo</p>}}<td>bar</td></table>
 <table>{{echo|<p>foo</p>}}<td>bar</td></table>
-!!result
+!! html
 <p typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>&quot;,{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;
 <p>foo</p>&quot;}},&quot;i&quot;:0}},&quot;
 <p typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;
 <table>&quot;,{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;
 <p>foo</p>&quot;}},&quot;i&quot;:0}},&quot;
@@ -18997,13 +19297,13 @@ parsoid=wt2wt,wt2html
 8. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
 8. Encapsulate foster-parented transclusion content
 !!options
 parsoid=wt2wt,wt2html
-!!input
+!! wikitext
 {{echo|a
 }}{|{{echo|style='color:red'}}
 |-
 |b
 |}
 {{echo|a
 }}{|{{echo|style='color:red'}}
 |-
 |b
 |}
-!!result
+!! html
 <p typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;a\n&quot;}},&quot;i&quot;:0}}]}">a</p><span typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;{|&quot;,{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;style&quot;:{&quot;wt&quot;:&quot;'color:red'&quot;}},&quot;i&quot;:0}},&quot;\n|-\n|b\n|}&quot;]}">{{{1}}}</span>
 <table>
 <tbody>
 <p typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;a\n&quot;}},&quot;i&quot;:0}}]}">a</p><span typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[&quot;{|&quot;,{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;style&quot;:{&quot;wt&quot;:&quot;'color:red'&quot;}},&quot;i&quot;:0}},&quot;\n|-\n|b\n|}&quot;]}">{{{1}}}</span>
 <table>
 <tbody>
@@ -19015,22 +19315,32 @@ parsoid=wt2wt,wt2html
 Table in fosterable position
 !!options
 parsoid=wt2html,wt2wt
 Table in fosterable position
 !!options
 parsoid=wt2html,wt2wt
-!!input
+!! wikitext
 {{OpenTable}}
 <div>
 {|
 |}
 </div>
 |}
 {{OpenTable}}
 <div>
 {|
 |}
 </div>
 |}
-!!result
-<div about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"OpenTable","href":"./Template:OpenTable"},"params":{},"i":0}},"\n&lt;div>"]}' data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[0,19,null,null],"src":"{{OpenTable}}\n&lt;div>","pi":[[]]}'></div><span about="#mwt1" data-parsoid="{}">
+!! html
+<div about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"OpenTable","href":"./Template:OpenTable"},"params":{},"i":0}},"\n&lt;div>"]}' data-parsoid='{"stx":"html","autoInsertedEnd":true,"pi":[[]]}'></div><span about="#mwt1" data-parsoid="{}">
 </span>
 </span>
-<table about="#mwt1" data-parsoid='{"autoInsertedEnd":true,"dsr":[null,19,2,0]}'></table>
+<table about="#mwt1" data-parsoid='{"autoInsertedEnd":true}'></table>
 
 
-<table data-parsoid='{"dsr":[20,25,2,2]}'>
+<table>
 </table>
 !!end
 
 </table>
 !!end
 
+!!test
+Support <object> element with .data attribute
+!!options
+parsoid=html2wt
+!! wikitext
+<object data="test.swf"></object>
+!! html
+<object data="test.swf"></object>
+!!end
+
 # -----------------------------------------------------------------
 # The following section of tests are primarily to spec requirements
 # around serialization of new/edited content.
 # -----------------------------------------------------------------
 # The following section of tests are primarily to spec requirements
 # around serialization of new/edited content.
@@ -19039,34 +19349,143 @@ parsoid=wt2html,wt2wt
 # ----------------------------------------------------------------
 
 !! test
 # ----------------------------------------------------------------
 
 !! test
-Image: Modifying size of an image
+Image: Modifying size of an image (1)
+!! options
+parsoid=html2wt
+!! wikitext
+[[Image:Foobar.jpg|200x200px]]
+!! html
+<p><span typeof="mw:Image" data-parsoid='{"optList":[{"ck":"width","ak":"230x230px"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/230px-Foobar.jpg" height="22" width="200" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"26","width":"230"},"sa":{"resource":"Image:Foobar.jpg"}}'/></a></span></p>
+!!end
+
+!! test
+Image: Modifying size of an image (2)
+!! options
+parsoid=html2wt
+!! wikitext
+[[Image:Foobar.jpg|500x500px]]
+!! html
+<p><span typeof="mw:Image" data-parsoid='{"optList":[{"ck":"width","ak":"230x230px"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/230px-Foobar.jpg" height="100" width="500" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"26","width":"230"},"sa":{"resource":"Image:Foobar.jpg"}}'/></a></span></p>
+!!end
+
+# note that the data-parsoid value conflicts with the figure's class
+!! test
+Image: Modifying alignment of an image (bug 48665)
+!! options
+parsoid=html2wt
+!! wikitext
+[[Image:Foobar.jpg|thumb|caption|left]]
+!! html
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"caption"},{"ck":"right","ak":"right"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" height="20" width="180" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"20","width":"180"},"sa":{"resource":"Image:Foobar.jpg"}}'/></a><figcaption>caption</figcaption></figure>
+!! end
+
+!! test
+Image: Modifying valign of an image (bug 49221)
+!! options
+parsoid=html2wt
+!! wikitext
+[[File:Foobar.jpg|20px|text-top]]
+!! html
+<p><span class="mw-valign-text-top" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"width","ak":"20px"},{"ck":"text_top","ak":"text-top"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" height="2" width="20" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"2","width":"20"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p>
+!! end
+
+!! test
+Image: Modifying alt attribute of an image (bug 56400)
 !! options
 parsoid=html2wt
 !! options
 parsoid=html2wt
-!! input
-[[Image:Wiki.png|230x230px]]
-!! result
-<p data-parsoid='{"dsr":[0,24,0,0]}'><span typeof="mw:Image" data-parsoid='{"optList":[{"ck":"width","ak":"100px"}],"cacheKey":"[[Image:Wiki.png|100px]]","img":{"h":115,"w":100,"wdset":true},"dsr":[0,24,null,null]}'><a href="./File:Wiki.png" data-parsoid='{"a":{"href":"./File:Wiki.png"}}'><img resource="./File:Wiki.png" src="//upload.wikimedia.org/wikipedia/en/thumb/b/bc/Wiki.png/100px-Wiki.png" height="230" width="200" data-parsoid='{"a":{"resource":"./File:Wiki.png"},"sa":{"resource":"Image:Wiki.png"}}'></a></span></p>
+!! wikitext
+[[File:Foobar.jpg|thumb|some caption|alt=some alternate edited text]]
+!! html
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"some caption"},{"ck":"alt","ak":"alt=some alternate text"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img alt="some alternate edited text" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" height="20" width="180" data-parsoid='{"a":{"alt":"some alternate edited text","resource":"./File:Foobar.jpg","height":"20","width":"180"},"sa":{"alt":"alt=some alternate edited text","resource":"File:Foobar.jpg"}}'/></a><figcaption>some caption</figcaption></figure>
 !!end
 
 !! test
 !!end
 
 !! test
-Image: New block level image should have \n before and after
+Image: Modifying caption of an image
 !! options
 parsoid=html2wt
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
+[[Image:Foobar.jpg|thumb|new caption]]
+!! html
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"original caption"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" height="20" width="180" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"20","width":"180"},"sa":{"resource":"Image:Foobar.jpg"}}'/></a><figcaption>new caption</figcaption></figure>
+!!end
+
+!! test
+Image: empty alt attribute (bug 48924)
+!! options
+parsoid
+!! wikitext
+[[File:Foobar.jpg|thumb|alt=|bar]]
+!! html
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"alt","ak":"alt="},{"ck":"caption","ak":"bar"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img alt="" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" height="25" width="220" data-parsoid='{"a":{"alt":"","resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"alt":"alt=","resource":"File:Foobar.jpg"}}'/></a><figcaption>bar</figcaption></figure>
+!! end
+
+#!! test
+#Image: new attributes should be serialized in wiki's language for RTL languages (bug 51852)
+#!! options
+#parsoid=html2wt
+#language=ar
+#!! input
+#[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]]
+#!! result
+#<figure class="mw-default-size mw-halign-right" typeof="mw:Image/Thumb"><a href="Imagen:Foobar.jpg"><img resource="./Imagen:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="20" width="180"/></a></figure>
+#!! end
+
+!! test
+Image: Block level image should have \n before and after
+!! options
+parsoid
+!! wikitext
+123
+[[File:Foobar.jpg|right|thumb|150x150px]]
+456
+!! html
+<p>123</p><figure typeof="mw:Image/Thumb" class="mw-halign-right"><a href="./File:Foobar.png"><img src="http://192.168.142.128/mw/images/thumb/b/bc/Foobar.png/131px-Foobar.png" width="131" height="150" resource="./File:Foobar.png" data-parsoid='{"a":{"resource":"./File:Foobar.png","width":"131"},"sa":{"resource":"File:Foobar.png","width":"150"}}'></a></figure><p>456</p>
+!!end
+
+!! test
+Image: New block level image should have \n before and after (existing
+content)
+!! options
+parsoid
+!! wikitext
 123
 123
-[[File:Wiki.png|right|thumb|150x150px]]
+[[File:Foobar.jpg|right|thumb|150x150px]]
 456
 456
-!! result
-<p>123</p><figure typeof="mw:Image/Thumb" class="mw-halign-right"><a href="./File:Wiki.png"><img src="http://192.168.142.128/mw/images/thumb/b/bc/Wiki.png/131px-Wiki.png" width="131" height="150" resource="./File:Wiki.png"></a></figure><p>456</p>
+!! html
+<p data-parsoid='{"dsr":[0,3,0,0]}'>123</p>
+<figure class="mw-halign-right" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"right","ak":"right"},{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"150x150px"}],"dsr":[4,45,2,2]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"dsr":[6,43,null,null]}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/150px-Foobar.jpg" height="17" width="150" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"17","width":"150"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></figure>
+<p data-parsoid='{"dsr":[46,49,0,0]}'>456</p>
+!!end
+
+!! test
+Images: upright option (parsoid)
+!! options
+parsoid
+!! wikitext
+[[File:Foobar.jpg|thumb|upright|caption]]
+[[File:Foobar.jpg|thumb|upright=0.5|caption]]
+[[File:Foobar.jpg|thumb|500x500px|upright=0.5|caption]]
+!! html
+<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="19" width="170"/></a><figcaption>caption</figcaption></figure><figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="19" width="170"/></a><figcaption>caption</figcaption></figure><figure typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="57" width="500"/></a><figcaption>caption</figcaption></figure>
+!!end
+
+!! test
+Images: upright option is ignored on inline and frame images (parsoid)
+!! options
+parsoid
+!! wikitext
+[[File:Foobar.jpg|500x500px|upright=0.5|caption]]
+!! html
+<p><span typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="57" width="500"/></a></span></p>
 !!end
 
 !! test
 Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does)
 !! options
 parsoid=html2wt
 !!end
 
 !! test
 Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does)
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 * foo
 * foo
-!! result
+!! html
 <ul>
 <li><p>foo</p></li>
 </ul>
 <ul>
 <li><p>foo</p></li>
 </ul>
@@ -19076,9 +19495,9 @@ parsoid=html2wt
 Lists: Serialize correctly even when list tags has unneeded whitespace between tags
 !! options
 parsoid=html2wt
 Lists: Serialize correctly even when list tags has unneeded whitespace between tags
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 * foo
 * foo
-!! result
+!! html
 <ul> <li>foo</li></ul>
 !! end
 
 <ul> <li>foo</li></ul>
 !! end
 
@@ -19086,7 +19505,7 @@ parsoid=html2wt
 Don't strip leading whitespace when handling indent-pre suppressing tags
 !! options
 parsoid=html2wt
 Don't strip leading whitespace when handling indent-pre suppressing tags
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 {|
   | indented row
 |}
 {|
   | indented row
 |}
@@ -19100,7 +19519,7 @@ parsoid=html2wt
 </blockquote>
 foo
  <div>bar</div>
 </blockquote>
 foo
  <div>bar</div>
-!! result
+!! html
 <table>
   <tr><td> indented row</td></tr>
 </table>
 <table>
   <tr><td> indented row</td></tr>
 </table>
@@ -19119,7 +19538,7 @@ foo
 Strip leading whitespace when handling indent-pre inducing tags
 !! options
 parsoid=html2wt
 Strip leading whitespace when handling indent-pre inducing tags
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 foo
 <span>bar</span>
 
 foo
 <span>bar</span>
 
@@ -19132,7 +19551,7 @@ foo
 <div>
 <span>foo</span>
 </div>
 <div>
 <span>foo</span>
 </div>
-!! result
+!! html
 <p>foo</p>
  <span>bar</span>
 
 <p>foo</p>
  <span>bar</span>
 
@@ -19151,11 +19570,11 @@ foo
 Lists: Add space after bullets
 !! options
 parsoid=html2wt
 Lists: Add space after bullets
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 * foo
 * bar
 * <span> baz</span>
 * foo
 * bar
 * <span> baz</span>
-!! result
+!! html
 <ul>
 <li>foo</li>
 <li> bar</li>
 <ul>
 <li>foo</li>
 <li> bar</li>
@@ -19163,11 +19582,22 @@ parsoid=html2wt
 </ul>
 !! end
 
 </ul>
 !! end
 
+!! test
+Lists: Dont insert newlines in a serialized list item.
+!! options
+parsoid=html2wt
+!! wikitext
+* a<br>b
+* c
+!! html
+<ul><li>a<br>b</li><li>c</li></ul>
+!! end
+
 !! test
 Headings: Add space before/after == (Bug 51744)
 !! options
 parsoid=html2wt
 !! test
 Headings: Add space before/after == (Bug 51744)
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 == foo ==
 
 == bar ==
 == foo ==
 
 == bar ==
@@ -19175,7 +19605,7 @@ parsoid=html2wt
 == baz ==
 
 == <span> baz</span> ==
 == baz ==
 
 == <span> baz</span> ==
-!! result
+!! html
 <h2>foo</h2>
 <h2> bar</h2>
 <h2>baz </h2>
 <h2>foo</h2>
 <h2> bar</h2>
 <h2>baz </h2>
@@ -19186,7 +19616,7 @@ parsoid=html2wt
 Parsoid: Serialize positional parameters with = in them as named parameter
 !! options
 parsoid=html2wt
 Parsoid: Serialize positional parameters with = in them as named parameter
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 {{echo|1 = f=oo}}
 
 {{echo|1 = f=oo|2 = bar}}
 {{echo|1 = f=oo}}
 
 {{echo|1 = f=oo|2 = bar}}
@@ -19194,7 +19624,7 @@ parsoid=html2wt
 <!--Orig params with data-parsoid has heuristics for handling = chars-->
 <!--FIXME: But maybe the heuristic needs fixing to apply to new params as well-->
 {{echo|<nowiki>f=oo</nowiki>|bar}}
 <!--Orig params with data-parsoid has heuristics for handling = chars-->
 <!--FIXME: But maybe the heuristic needs fixing to apply to new params as well-->
 {{echo|<nowiki>f=oo</nowiki>|bar}}
-!! result
+!! html
 <p about="#mwt1" typeof="mw:Transclusion"
 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"f=oo"}},"i":0}}]}'>foo</p>
 
 <p about="#mwt1" typeof="mw:Transclusion"
 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"f=oo"}},"i":0}}]}'>foo</p>
 
@@ -19210,7 +19640,7 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
 Parsoid: Correctly serialize block-node children when they are a combination of text and p-nodes
 !! options
 parsoid=html2wt
 Parsoid: Correctly serialize block-node children when they are a combination of text and p-nodes
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 <div>a
 b
 </div>
 <div>a
 b
 </div>
 
 b
 </div>
 
 b
 </div>
-!! result
+!! html
 <div>a<p>b</p></div>
 <div>a
 <p>b</p></div>
 <div>a<p>b</p></div>
 <div>a
 <p>b</p></div>
 1. I/B quote minimization: wikitext-only tags should be combined
 !! options
 parsoid=html2wt
 1. I/B quote minimization: wikitext-only tags should be combined
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 ''AB''
 
 '''AB'''
 ''AB''
 
 '''AB'''
@@ -19255,7 +19685,7 @@ parsoid=html2wt
 '''''AB'''''
 
 '''''AB'''''
 '''''AB'''''
 
 '''''AB'''''
-!! result
+!! html
 <p><i>A</i><i>B</i></p>
 <p><b>A</b><b>B</b></p>
 <p><i>A</i><b><i>B</i></b></p>
 <p><i>A</i><i>B</i></p>
 <p><b>A</b><b>B</b></p>
 <p><i>A</i><b><i>B</i></b></p>
@@ -19270,11 +19700,11 @@ parsoid=html2wt
 2. I/B quote minimization: wikitext and html tags should not be combined
 !! options
 parsoid=html2wt
 2. I/B quote minimization: wikitext and html tags should not be combined
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 ''A''<i>B</i>
 
 ''A'''''<i>B</i>'''
 ''A''<i>B</i>
 
 ''A'''''<i>B</i>'''
-!! result
+!! html
 <p><i>A</i><i data-parsoid='{"stx":"html"}'>B</i></p>
 <p><i>A</i><b><i data-parsoid='{"stx":"html"}'>B</i></b></p>
 !! end
 <p><i>A</i><i data-parsoid='{"stx":"html"}'>B</i></p>
 <p><i>A</i><b><i data-parsoid='{"stx":"html"}'>B</i></b></p>
 !! end
@@ -19283,11 +19713,11 @@ parsoid=html2wt
 3. I/B quote minimization: templated content stops minimization
 !! options
 parsoid=html2wt
 3. I/B quote minimization: templated content stops minimization
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 ''A''{{echo|''B''}}
 
 ''A''{{echo|'''''B'''''}}
 ''A''{{echo|''B''}}
 
 ''A''{{echo|'''''B'''''}}
-!! result
+!! html
 <p><i>A</i><i about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&#39;&#39;B&#39;&#39;"}},"i":0}}]}'>B</i>
 <p><i>A</i><b about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&#39;&#39;&#39;&#39;&#39;B&#39;&#39;&#39;&#39;&#39;"}},"i":0}}]}'><i>B</i></b>
 !! end
 <p><i>A</i><i about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&#39;&#39;B&#39;&#39;"}},"i":0}}]}'>B</i>
 <p><i>A</i><b about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&#39;&#39;&#39;&#39;&#39;B&#39;&#39;&#39;&#39;&#39;"}},"i":0}}]}'><i>B</i></b>
 !! end
@@ -19296,13 +19726,13 @@ parsoid=html2wt
 4. I/B quote minimization: new content should be mimimized with adjacent old content
 !! options
 parsoid=html2wt
 4. I/B quote minimization: new content should be mimimized with adjacent old content
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 ''AB''
 
 '''AB'''
 
 ''A'''B'''''
 ''AB''
 
 '''AB'''
 
 ''A'''B'''''
-!! result
+!! html
 <p><i>A</i><i data-parsoid='{}'>B</i></p>
 <p><b data-parsoid='{}'>A</b><b>B</b></p>
 <p><i>A</i><b data-parsoid='{}'><i data-parsoid='{}'>B</i></b></p>
 <p><i>A</i><i data-parsoid='{}'>B</i></p>
 <p><b data-parsoid='{}'>A</b><b>B</b></p>
 <p><i>A</i><b data-parsoid='{}'><i data-parsoid='{}'>B</i></b></p>
@@ -19316,9 +19746,9 @@ parsoid=html2wt
 Bug 54262: New entities
 !! options
 parsoid=html2wt
 Bug 54262: New entities
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 foo
 foo
-!! result
+!! html
 <span typeof="mw:Entity">foo</span>
 !! end
 
 <span typeof="mw:Entity">foo</span>
 !! end
 
@@ -19329,7 +19759,7 @@ foo
 Magic words
 !! options
 parsoid=html2wt
 Magic words
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 __TOC__
 __NOTOC__
 __FORCETOC__
 __TOC__
 __NOTOC__
 __FORCETOC__
@@ -19339,7 +19769,7 @@ __NOGALLERY__
 __NOEDITSECTION__
 __NOTITLECONVERT__
 __NOCONTENTCONVERT__
 __NOEDITSECTION__
 __NOTITLECONVERT__
 __NOCONTENTCONVERT__
-!! result
+!! html
 <meta property='mw:PageProp/toc' />
 <meta property='mw:PageProp/notoc' />
 <meta property='mw:PageProp/forcetoc' />
 <meta property='mw:PageProp/toc' />
 <meta property='mw:PageProp/notoc' />
 <meta property='mw:PageProp/forcetoc' />
@@ -19356,7 +19786,7 @@ __NOCONTENTCONVERT__
 Consecutive <pre>s should not get merged
 !! options
 parsoid=html2wt,html2html
 Consecutive <pre>s should not get merged
 !! options
 parsoid=html2wt,html2html
-!! input
+!! wikitext
  a
 
  b
  a
 
  b
@@ -19370,7 +19800,7 @@ parsoid=html2wt,html2html
 
  
  f
 
  
  f
-!! result
+!! html
 <pre>a</pre><pre>b</pre>
 
 <pre>c
 <pre>a</pre><pre>b</pre>
 
 <pre>c
@@ -19388,9 +19818,9 @@ f</pre>
 Edited ISBN links not serializable as ISBN links should serialize as wikilinks
 !! options
 parsoid=html2wt
 Edited ISBN links not serializable as ISBN links should serialize as wikilinks
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 [[Special:BookSources/1234567890|ISBN 1234567895]]
 [[Special:BookSources/1234567890|ISBN 1234567895]]
-!! result
+!! html
 <a rel="mw:ExtLink" href="./Special:BookSources/1234567890">ISBN 1234567895</a>
 !! end
 
 <a rel="mw:ExtLink" href="./Special:BookSources/1234567890">ISBN 1234567895</a>
 !! end
 
@@ -19398,9 +19828,9 @@ parsoid=html2wt
 Edited RFC links not serializable as RFC links should serialize as extlinks
 !! options
 parsoid=html2wt
 Edited RFC links not serializable as RFC links should serialize as extlinks
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 [//tools.ietf.org/html/rfc123 New RFC]
 [//tools.ietf.org/html/rfc123 New RFC]
-!! result
+!! html
 <a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink">New RFC</a>
 !! end
 
 <a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink">New RFC</a>
 !! end
 
@@ -19408,12 +19838,22 @@ parsoid=html2wt
 Edited PMID links not serializable as PMID links should serialize as extlinks
 !! options
 parsoid=html2wt
 Edited PMID links not serializable as PMID links should serialize as extlinks
 !! options
 parsoid=html2wt
-!! input
+!! wikitext
 [//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract New PMID]
 [//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract New PMID]
-!! result
+!! html
 <a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink">New PMID</a>
 !! end
 
 <a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink">New PMID</a>
 !! end
 
+!! test
+Edited Redirect link should emit a non-piped wikitext link
+!! options
+parsoid=html2wt
+!! wikitext
+#REDIRECT [[Bar]]
+!! html
+<link rel="mw:PageProp/redirect" href="Bar" data-parsoid='{"src":"#REDIRECT ","a":{"href":"./Foo"},"sa":{"href":"Foo"}}'>
+!! end
+
 # -----------------------------------------------------------------
 # End of section for Parsoid-only html2wt tests for serialization
 # of new content
 # -----------------------------------------------------------------
 # End of section for Parsoid-only html2wt tests for serialization
 # of new content