Deprecate the 'disabletidy' parameter for ApiParse
authorC. Scott Ananian <cscott@cscott.net>
Fri, 21 Sep 2018 14:57:18 +0000 (10:57 -0400)
committerC. Scott Ananian <cscott@cscott.net>
Mon, 24 Sep 2018 21:40:51 +0000 (17:40 -0400)
This will be unsupported by future wikitext parsers, which always
construct well-formed HTML.

Bug: T198214
Change-Id: Ic189cd1b38bca5b9ec0ef9810555fe0cbd8b733d

RELEASE-NOTES-1.32
includes/api/ApiParse.php
tests/phpunit/includes/api/ApiParseTest.php

index 72c47b6..499bf58 100644 (file)
@@ -167,6 +167,9 @@ production.
     content is not being preserved. 'fromsection-{slot}' and 'tosection-{slot}'
     instead expand the given text as if for a section edit. This effectively
     declines T183823 in favor of T185723.
+* (T198214) The 'disabletidy' parameter to action=parse has been
+  deprecated; untidy output will not be supported by future wikitext
+  parsers.
 
 === Action API internal changes in 1.32 ===
 * Added 'ApiParseMakeOutputPage' hook.
index 5c25b5a..a78cb7f 100644 (file)
@@ -868,7 +868,10 @@ class ApiParse extends ApiBase {
                        ],
                        'disablelimitreport' => false,
                        'disableeditsection' => false,
-                       'disabletidy' => false,
+                       'disabletidy' => [
+                               ApiBase::PARAM_DFLT => false,
+                               ApiBase::PARAM_DEPRECATED => true, // Since 1.32
+                       ],
                        'disablestylededuplication' => false,
                        'generatexml' => [
                                ApiBase::PARAM_DFLT => false,
index 7f2c1a6..b20d43e 100644 (file)
@@ -97,8 +97,7 @@ class ApiParseTest extends ApiTestCase {
                        $this->assertCount( 1, $res[0] );
                } else {
                        $this->assertCount( 2, $res[0] );
-                       // This deliberately fails if there are extra warnings
-                       $this->assertSame( [ 'parse' => [ 'warnings' => $warnings ] ], $res[0]['warnings'] );
+                       $this->assertSame( [ 'warnings' => $warnings ], $res[0]['warnings']['parse'] );
                }
        }
 
@@ -827,7 +826,8 @@ class ApiParseTest extends ApiTestCase {
                        'disabletidy' => '',
                ] );
 
-               $this->assertParsedTo( "<p><b>Mixed <i>up</b></i>\n</p>", $res2 );
+               $this->assertParsedTo( "<p><b>Mixed <i>up</b></i>\n</p>", $res2,
+                       'The parameter "disabletidy" has been deprecated.' );
        }
 
        public function testFormatCategories() {