Don't infer parsoid-only parser tests based on presence of parsoid option.
authorC. Scott Ananian <cscott@cscott.net>
Tue, 4 Aug 2015 20:06:15 +0000 (16:06 -0400)
committerC. Scott Ananian <cscott@cscott.net>
Fri, 2 Nov 2018 20:41:40 +0000 (16:41 -0400)
For historical reasons, we used a complicated test to try to determine
if a test is "parsoid only" based on the presence of the string "parsoid"
in the parser test options clause.  But really test clauses should be
marked up specifically as html/php or html/parsoid, we don't need to
play hacky games any more.  Remove some unnecessary code and simplify
the test logic.

Change-Id: Ia331e7e12a75aa19aeb96601712f169f2aa75bf9

tests/parser/ParserTestRunner.php
tests/parser/TestFileReader.php
tests/parser/parserTests.php
tests/parser/parserTests.txt

index 5c4c48c..12c60a7 100644 (file)
@@ -122,12 +122,6 @@ class ParserTestRunner {
         */
        private $runDisabled;
 
-       /**
-        * Run tests intended only for parsoid
-        * @var bool
-        */
-       private $runParsoid;
-
        /**
         * Disable parse on article insertion
         * @var bool
@@ -170,7 +164,6 @@ class ParserTestRunner {
                $this->fileBackendName = $options['file-backend'] ?? false;
 
                $this->runDisabled = !empty( $options['run-disabled'] );
-               $this->runParsoid = !empty( $options['run-parsoid'] );
 
                $this->disableSaveParse = !empty( $options['disable-save-parse'] );
 
@@ -704,7 +697,6 @@ class ParserTestRunner {
                        foreach ( $filenames as $filename ) {
                                $testFileInfo = TestFileReader::read( $filename, [
                                        'runDisabled' => $this->runDisabled,
-                                       'runParsoid' => $this->runParsoid,
                                        'regex' => $this->regex ] );
 
                                // Don't start the suite if there are no enabled tests in the file
index a96485d..8a11b4c 100644 (file)
@@ -28,7 +28,6 @@ class TestFileReader {
        private $sectionLineNum = [];
        private $lineNum = 0;
        private $runDisabled;
-       private $runParsoid;
        private $regex;
 
        private $articles = [];
@@ -66,11 +65,9 @@ class TestFileReader {
 
                $options = $options + [
                        'runDisabled' => false,
-                       'runParsoid' => false,
                        'regex' => '//',
                ];
                $this->runDisabled = $options['runDisabled'];
-               $this->runParsoid = $options['runParsoid'];
                $this->regex = $options['regex'];
        }
 
@@ -112,13 +109,6 @@ class TestFileReader {
                        }
                }
 
-               if ( preg_match( '/\\bparsoid\\b/i', $data['options'] ) && $nonTidySection === 'html'
-                       && !$this->runParsoid
-               ) {
-                       // A test which normally runs on Parsoid but can optionally be run with MW
-                       return;
-               }
-
                if ( !preg_match( $this->regex, $data['test'] ) ) {
                        // Filtered test
                        return;
index e1d943f..19d5684 100644 (file)
@@ -61,7 +61,6 @@ class ParserTestsMaintenance extends Maintenance {
                        'conjunction with --keep-uploads. Causes a real (non-mock) file backend to ' .
                        'be used.', false, true );
                $this->addOption( 'run-disabled', 'run disabled tests' );
-               $this->addOption( 'run-parsoid', 'run parsoid tests (normally disabled)' );
                $this->addOption( 'disable-save-parse', 'Don\'t run the parser when ' .
                        'inserting articles into the database' );
                $this->addOption( 'dwdiff', 'Use dwdiff to display diff output' );
@@ -181,7 +180,6 @@ class ParserTestsMaintenance extends Maintenance {
                        'regex' => $regex,
                        'keep-uploads' => $this->hasOption( 'keep-uploads' ),
                        'run-disabled' => $this->hasOption( 'run-disabled' ),
-                       'run-parsoid' => $this->hasOption( 'run-parsoid' ),
                        'disable-save-parse' => $this->hasOption( 'disable-save-parse' ),
                        'use-tidy-config' => $this->hasOption( 'use-tidy-config' ),
                        'file-backend' => $this->getOption( 'file-backend' ),
index dc7cafb..30cd372 100644 (file)
@@ -2914,6 +2914,23 @@ Self-closed pre
 <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{}}'></pre>
 !! end
 
+!! test
+Newline before table-close generates empty table row: T208619
+!! wikitext
+{|
+
+|}
+!! html/php+tidy
+<table>
+
+<tbody><tr><td></td></tr></tbody></table>
+!! html/parsoid
+<table data-parsoid='{}'>
+
+</table>
+!! end
+
+# PHP has one more row in the output than Parsoid does: T208619
 !! test
 Parsoid: Don't paragraph-wrap fosterable content even if table syntax is unbalanced
 !! options
@@ -2927,7 +2944,16 @@ parsoid=wt2html
 
 
 |}
-!! html
+!! html/php+tidy
+<table>
+<tbody><tr><td>
+</td><td>
+</td>
+
+
+
+</tr><tr><td></td></tr></tbody></table>
+!! html/parsoid
 <table>
 
 <tbody>
@@ -3205,12 +3231,13 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
 
 !! test
 Parsoid: Pipe in template with nested template in external link target in template parameter (seriously)
-!! options
-parsoid
 !! wikitext
 {{echo|[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]}}
-!! html
-<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]"}},"i":0}}]}'>[Main Page bar]</p>
+!! html/php+tidy
+<p><a rel="nofollow" class="external text" href="http://example.org/index.php?title=Parser_test&amp;action=edit">bar</a>
+</p>
+!! html/parsoid
+<p><a rel="mw:ExtLink" class="external text" href="http://example.org/index.php?title=Parser_test&amp;action=edit" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]"}},"i":0}}]}'>bar</a></p>
 !! end
 
 !! test
@@ -6246,6 +6273,8 @@ parsoid=wt2html
 
 !! end
 
+# Note that the PHP parser output appears to be broken when the table
+# end tag is not separated by a space from the style attribute
 !! test
 A table with stray table end tags on start tag line (wt2html)
 !! options
@@ -6264,7 +6293,22 @@ parsoid=wt2html
 {|style="color: red;" |} id="foo"
 |foo
 |}
-!! html
+!! html/php+tidy
+<table style="&quot;color:">
+
+</table><table style="color: red;">
+<tbody><tr>
+<td>foo
+</td></tr></tbody></table>
+<table style="&quot;color:" id="foo">
+<tbody><tr>
+<td>foo
+</td></tr></tbody></table>
+<table style="color: red;" id="foo">
+<tbody><tr>
+<td>foo
+</td></tr></tbody></table>
+!! html/parsoid
 <table style="color: red;"></table>
 
 <table style="color: red;">
@@ -7495,6 +7539,7 @@ foo
 </tbody></table>
 !!end
 
+# Note: PHP parser omits empty rows
 !! test
 Tables: Digest broken attributes on table and tr tag
 !! options
@@ -7504,7 +7549,12 @@ parsoid=wt2html
 |- || || ++ --
 |- > [
 |}
-!! html
+!! html/php+tidy
+<table>
+
+
+</table>
+!! html/parsoid
 <table>
 <tbody>
 <tr class='mw-empty-elt'></tr>
@@ -7619,7 +7669,7 @@ parsoid=html2wt
 Wikitext tables can be nested inside HTML tables
 !! options
 parsoid=html2wt
-!! html
+!! html/parsoid
 <table data-parsoid='{"stx":"html"}'>
 <tr><td>
 <table>
@@ -7635,6 +7685,15 @@ parsoid=html2wt
 |}
 </td></tr>
 </table>
+!! html/php+tidy
+<table>
+<tbody><tr><td>
+<table>
+<tbody><tr>
+<td>foo
+</td></tr></tbody></table>
+</td></tr>
+</tbody></table>
 !! end
 
 ###
@@ -8533,27 +8592,32 @@ parsoid=html2wt
 1. Interaction of linktrail and template encapsulation
 !! wikitext
 {{echo|[[Foo]]}}l
+!! html/php+tidy
+<p><a href="/wiki/Foo" title="Foo">Fool</a>
+</p>
 !! html/parsoid
 <p><a rel="mw:WikiLink" href="./Foo" title="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
+!! html/php+tidy
+<p>Some <a href="/index.php?title=Fool&amp;action=edit&amp;redlink=1" class="new" title="Fool (page does not exist)">Fools</a>
+</p>
+!! html/parsoid
 <p><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"}]]}'>Some </span><a rel="mw:WikiLink" href="./Fool" title="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
+!! html/php+tidy
+<p>Some <a href="/index.php?title=Fool&amp;action=edit&amp;redlink=1" class="new" title="Fool (page does not exist)">Fools</a> are <b>bold and foolish</b>
+</p>
+!! html/parsoid
 <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"}]]}'>Some <a rel="mw:WikiLink" href="./Fool" title="Fool" data-parsoid='{"stx":"simple","a":{"href":"./Fool"},"sa":{"href":"Fool"},"tail":"s"}'>Fools</a> are <b>bold and foolish</b></p>
 !! end
 
@@ -8733,15 +8797,13 @@ parsoid=wt2html,wt2wt
 !! wikitext
 *[[Wikipedia:ro:Olteni&#0355;a]]
 *[[Wikipedia:ro:Olteni&#355;a]]
-!! html
+!! html/php
 <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>
 <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>
 
 !! html/php+tidy
-<ul>
-<li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteniţa</a></li>
-<li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteniţa</a></li>
-</ul>
+<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>
+<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>
 !! html/parsoid
 <ul>
 <li><a rel="mw:WikiLink/Interwiki" href="http://en.wikipedia.org/wiki/ro:Olteniţa" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteniţa</a></li>
@@ -9910,12 +9972,14 @@ Nested lists 8 (multiple nesting transitions)
 
 !! end
 
+# XXX this test should be moved to citeParserTests, since it depends
+# on the Cite extension, which is "built in" to Parsoid.
 !! test
 Nested lists 9 (extension interaction)
-!! options
-parsoid
 !! wikitext
 *<references />
+!! html/php+tidy-DISABLED
+<ul><li class="mw-empty-elt"></li></ul>
 !! html/parsoid
 <ul><li data-parsoid='{}'><ol class="mw-references references" typeof="mw:Extension/references" about="#mwt2" data-parsoid='{}' data-mw='{"name":"references","attrs":{}}'></ol></li></ul>
 !! end
@@ -10154,8 +10218,6 @@ parsoid=wt2html,wt2wt
 
 !! test
 Parsoid: Make sure nested lists are serialized on their own line even if HTML contains no newlines
-!! options
-parsoid
 !! wikitext
 #foo
 ##bar
@@ -10165,7 +10227,14 @@ parsoid
 
 :foo
 ::bar
-!! html
+!! html/php+tidy
+<ol><li>foo
+<ol><li>bar</li></ol></li></ol>
+<ul><li>foo
+<ul><li>bar</li></ul></li></ul>
+<dl><dd>foo
+<dl><dd>bar</dd></dl></dd></dl>
+!! html/parsoid
 <ol>
 <li>foo<ol>
 <li>bar</li>
@@ -10944,8 +11013,16 @@ Aoeu
 # From plwiki:PLOS_ONE
 !! test
 Parsoid: Page property magic word with magic word contents
+!! options
+showtitle
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=false
 !! wikitext
 {{DISPLAYTITLE:''{{PAGENAME}}''}}
+!! html/php+tidy
+<i>Parser test</i>
+
 !! html/parsoid
 <meta property="mw:PageProp/displaytitle" content="Main Page" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"src":"{{DISPLAYTITLE:&#39;&#39;{{PAGENAME}}&#39;&#39;}}"}' data-mw='{"attribs":[[{"txt":"content"},{"html":"DISPLAYTITLE:&lt;i data-parsoid=&#39;{\"dsr\":[15,31,2,2]}&#39;>&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[]],\"dsr\":[17,29,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGENAME\",\"function\":\"pagename\"},\"params\":{},\"i\":0}}]}&#39;>Main Page&lt;/span>&lt;/i>"}]]}'/>
 !! end
@@ -12184,7 +12261,18 @@ c}}d
 <table></table>
 
 b}}
-!! html
+!! html/php+tidy
+<p>ab</p><table></table><p>cd
+</p><p>ab
+</p>
+<table></table>
+<p>cd
+</p><p>a
+</p>
+<table></table>
+<p>b
+</p>
+!! html/parsoid
 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["a",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b&lt;table>&lt;/table>c"}},"i":0}},"d"]}' data-parsoid='{"pi":[[{"k":"1"}]]}'>ab</p><table about="#mwt1" data-parsoid='{"stx":"html"}'></table><p about="#mwt1">cd</p>
 
 <p about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":["a",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b\n&lt;table>&lt;/table>\nc"}},"i":0}},"d"]}' data-parsoid='{"pi":[[{"k":"1"}]]}'>ab</p><span about="#mwt2">
@@ -12200,13 +12288,16 @@ b}}
 
 !! test
 Parsoid: Merge double tds (T52603)
-!! options
-parsoid
 !! wikitext
 {|
 |{{echo|{{!}} foo}}
 |}
-!! html
+!! html/php+tidy
+<table>
+<tbody><tr>
+<td>foo
+</td></tr></tbody></table>
+!! html/parsoid
 <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>
@@ -12214,15 +12305,20 @@ parsoid
 
 !! test
 Parsoid: Merge double tds in nested transclusion content (T52603)
-!! options
-parsoid
 !! wikitext
 {{echo|<div>}}
 {|
 |{{echo|{{!}} foo}}
 |}
 {{echo|</div>}}
-!! html
+!! html/php+tidy
+<div>
+<table>
+<tbody><tr>
+<td>foo
+</td></tr></tbody></table>
+</div>
+!! html/parsoid
 <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>
@@ -12956,14 +13052,15 @@ bar <div>baz</div>
 bar </p><div>baz</div>
 !! end
 
-!!test
+!! test
 Templates: P-wrapping: 1d. Template preceded by comment-only line
-!!options
-parsoid
 !! wikitext
 <!-- foo -->
 {{echo|Bar}}
-!! html
+!! html/php+tidy
+<p>Bar
+</p>
+!! html/parsoid
 <!-- 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>
@@ -12976,7 +13073,10 @@ parsoid=wt2html,wt2wt
 !! wikitext
 {{echo|<div>a</div>}}b{{echo|
 <div>c</div>}}
-!! html
+!! html/php+tidy
+<div>a</div><p>b
+</p><div>c</div>
+!! html/parsoid
 <div about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;div>a&lt;/div>"}},"i":0}}]}'>a</div><p>b</p><span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"\n&lt;div>c&lt;/div>"}},"i":0}}]}'>
 </span><div about="#mwt2">c</div>
 !! end
@@ -13393,7 +13493,10 @@ parsoid=wt2html,wt2wt
 <table>[[Category:foo1]]<tr><td>foo</td></tr></table>
 <!--Two categories (T52330)-->
 <table>[[Category:bar1]][[Category:bar2]]<tr><td>foo</td></tr></table>
-!! html
+!! html/php+tidy
+<table><tbody><tr><td>foo</td></tr></tbody></table>
+<table><tbody><tr><td>foo</td></tr></tbody></table>
+!! html/parsoid
 <link rel="mw:PageProp/Category" href="./Category:Foo1"><table><tbody><tr><td>foo</td></tr></tbody></table>
 <!--Two categories (T52330)-->
 <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>
@@ -13609,7 +13712,9 @@ Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div
 parsoid=wt2html,wt2wt
 !! wikitext
 {{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}}
-!! html
+!! html/php+tidy
+<div><i>a</i></div><div><i>b</i>c<i>d</i></div><div>e</div>
+!! html/parsoid
 <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>
@@ -14317,7 +14422,10 @@ Parsoid: Recognize nowiki with odd capitalization
 parsoid=wt2html
 !! wikitext
 <noWikI ><div>[[foo]]</Nowiki >
-!! html
+!! html/php+tidy
+<p>&lt;div&gt;[[foo]]
+</p>
+!! html/parsoid
 <p><span typeof="mw:Nowiki">&lt;div&gt;[[foo]]</span></p>
 !! end
 
@@ -16723,7 +16831,7 @@ parsoid=wt2html
 * So should this
 
 {{echo|[[Category:Foo]] and this should be part of the same list item}}
-!! html
+!! html/php+tidy
 <ul><li>This and this should be part of the same list item</li>
 <li>So should this and this should be part of the same list item</li></ul>
 !! html/parsoid
@@ -16936,13 +17044,15 @@ Category links with multiple namespaces
 
 !! test
 Parsoid: Serialize link to category page with colon escape
-!! options
-parsoid
 !! wikitext
 
 [[:Category:Foo]]
 [[:Category:Foo|Bar]]
-!! html
+!! html/php+tidy
+<p><a href="/index.php?title=Category:Foo&amp;action=edit&amp;redlink=1" class="new" title="Category:Foo (page does not exist)">Category:Foo</a>
+<a href="/index.php?title=Category:Foo&amp;action=edit&amp;redlink=1" class="new" title="Category:Foo (page does not exist)">Bar</a>
+</p>
+!! html/parsoid
 <p>
 <a rel="mw:WikiLink" href="./Category:Foo" title="Category:Foo">Category:Foo</a>
 <a rel="mw:WikiLink" href="./Category:Foo" title="Category:Foo">Bar</a>
@@ -16989,13 +17099,15 @@ x[[es:Foo]]y
 
 !! test
 Parsoid: Serialize link to file page with colon escape
-!! options
-parsoid
 !! wikitext
 
 [[:File:Foo.png]]
 [[:File:Foo.png|Bar]]
-!! html
+!! html/php+tidy
+<p><a href="/index.php?title=File:Foo.png&amp;action=edit&amp;redlink=1" class="new" title="File:Foo.png (page does not exist)">File:Foo.png</a>
+<a href="/index.php?title=File:Foo.png&amp;action=edit&amp;redlink=1" class="new" title="File:Foo.png (page does not exist)">Bar</a>
+</p>
+!! html/parsoid
 <p>
 <a rel="mw:WikiLink" href="./File:Foo.png" title="File:Foo.png">File:Foo.png</a>
 <a rel="mw:WikiLink" href="./File:Foo.png" title="File:Foo.png">Bar</a>
@@ -17004,12 +17116,11 @@ parsoid
 
 !! test
 Parsoid: Serialize a genuine category link without colon escape
-!! options
-parsoid
 !! wikitext
 [[Category:Foo]]
 [[Category:Foo|Bar]]
-!! html
+!! html/php+tidy
+!! html/parsoid
 <link rel="mw:PageProp/Category" href="./Category:Foo">
 <link rel="mw:PageProp/Category" href="./Category:Foo#Bar">
 !! end
@@ -19728,19 +19839,17 @@ parsoid=wt2html,html2html
 !! wikitext
 ==a==
 {| STYLE=__TOC__
-!! html
+!! html/php
 <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>
 </table>
 
-!! html+tidy
+!! html/php+tidy
 <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="__TOC__">
-<tr>
-<td></td>
-</tr>
-</table>
+<table style="&#95;_TOC&#95;_">
+<tbody><tr><td></td></tr>
+</tbody></table>
 !! html/parsoid
 <h2 id="a">a</h2>
 <table style="__TOC__"></table>
@@ -25582,13 +25691,17 @@ Lead
 ###
 !!test
 1. SOL-sensitive wikitext tokens as template-args
-!!options
+!! options
 parsoid=wt2html,wt2wt
 !! wikitext
 {{echo|*a}}
 {{echo|#a}}
 {{echo|:a}}
-!! html
+!! html/php+tidy
+<ul><li>a</li></ul>
+<ol><li>a</li></ol>
+<dl><dd>a</dd></dl>
+!! html/parsoid
 <span about="#mwt1" typeof="mw:Transclusion">
 </span><ul about="#mwt1"><li>a</li>
 </ul>
@@ -27921,17 +28034,20 @@ Indent and comment before table row
 </tbody></table>
 !! end
 
-# Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext
+# PHP parser omits empty TR
 !!test
 Empty TR followed by a template-generated TR
-!!options
-parsoid
 !! wikitext
 {|
 |-
 {{echo|<tr><td>foo</td></tr>}}
 |}
-!! html
+!! html/php+tidy
+<table>
+
+<tbody><tr><td>foo</td></tr>
+</tbody></table>
+!! html/parsoid
 <table>
 <tbody>
 <tr class='mw-empty-elt'></tr>
@@ -27940,12 +28056,10 @@ parsoid
 </tbody></table>
 !!end
 
-## PHP and parsoid output differ for this, and since this is primarily
-## for testing Parsoid's serializer, marking this Parsoid only
+## PHP and parsoid output differ for this; as usual PHP omits empty
+## elements, and since it strips the comments the TR is empty.
 !!test
 Empty TR followed by mixed-ws-comment line should RT correctly
-!!options
-parsoid
 !! wikitext
 {|
 |-
@@ -27953,7 +28067,12 @@ parsoid
 |-
 <!--c--> <!--d-->
 |}
-!! html
+!! html/php+tidy
+<table>
+
+
+</table>
+!! html/parsoid
 <table>
 <tbody>
 <tr class='mw-empty-elt'></tr>
@@ -28621,11 +28740,11 @@ parsoid={
 
 !! test
 Image: empty alt attribute (T50924)
-!! options
-parsoid
 !! wikitext
 [[File:Foobar.jpg|thumb|alt=|bar]]
-!! html
+!! html/php+tidy
+<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"></a></div>bar</div></div></div>
+!! html/parsoid
 <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" data-file-width="1941" data-file-height="220" data-file-type="bitmap" 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
 
@@ -29892,7 +30011,7 @@ parsoid={
 Serialize wikitext list items as HTML list items when embedded in a HTML list
 !! options
 parsoid=html2wt
-!! html
+!! html/parsoid
 <ul data-parsoid='{"stx": "html"}'>
 <li data-parsoid='{}'>a</li>
 <li>b</li>
@@ -29902,17 +30021,22 @@ parsoid=html2wt
 <li>a</li>
 <li>b</li>
 </ul>
+!! html/php+tidy
+<ul>
+<li>a</li>
+<li>b</li>
+</ul>
 !! end
 
-# SSS FIXME: Is this actually a good thing given the
-# odd nested list output that is generated by MW?
+# Nested list should be inside <li>, that is
 # <ul><li>foo<ul>..</ul></li></ul> instead of
 # <ul><li>foo</li><ul>..</ul></ul>
+# See https://stackoverflow.com/questions/5899337/proper-way-to-make-html-nested-list
 !! test
 Wikitext lists can be nested inside HTML lists
 !! options
 parsoid=html2wt
-!! html
+!! html/parsoid
 <ul data-parsoid='{"stx": "html"}'>
 <li data-parsoid='{"stx": "html"}'>a
 <ul><li>b</li></ul>
@@ -29936,6 +30060,17 @@ parsoid=html2wt
 * y
 </li>
 </ul>
+!! html/php+tidy
+<ul>
+<li>a
+<ul><li>b</li></ul>
+</li>
+</ul>
+<ul>
+<li>x
+<ul><li>y</li></ul>
+</li>
+</ul>
 !! end
 
 !! test
@@ -30379,7 +30514,7 @@ parsoid={
   "modes": ["html2wt"],
   "scrubWikitext": true
 }
-!! html
+!! html/parsoid
 <h2><i></i></h2>
 <p><a href='Foo' rel='mw:WikiLink'>foo<i></i>
  </a><b><i></i></b>x</p>
@@ -30537,7 +30672,7 @@ parsoid={
   "modes": ["html2wt"],
   "scrubWikitext": false
 }
-!! html
+!! html/parsoid
 <table>
 <tr><td>a</td></tr>
 <tr><td>-</td></tr>
@@ -30560,7 +30695,7 @@ parsoid={
   "modes": ["html2wt"],
   "scrubWikitext": true
 }
-!! html
+!! html/parsoid
 <table>
 <tr><td>a</td></tr>
 <tr><td>-</td></tr>
@@ -30717,7 +30852,7 @@ parsoid={
   "modes": ["html2wt"],
   "scrubWikitext": true
 }
-!! html
+!! html/parsoid
 <font>foo</font>
 <font><font>bar</font></font>
 <font class="x">boo</font>
@@ -30734,7 +30869,7 @@ parsoid={
   "modes": ["html2wt"],
   "scrubWikitext": false
 }
-!! html
+!! html/parsoid
 <font>foo</font>
 !! wikitext
 <font>foo</font>