Phuedx has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364230 )

Change subject: Hygiene: Remove wgMFTidyMobileViewSections
......................................................................

Hygiene: Remove wgMFTidyMobileViewSections

wgMFTidyMobileViewSections was unconditionally set to false on all
production wikis in I35bdf93b. The concern that the apps could handle
untidy (imbalanced) HTML in the mobileview response is now moot as they
consume the Mobile Content Service family of services, which transform
and return valid HTML5 from Parsoid.

Bug: T168671
Change-Id: I4c8f5437dc25eec8f1ea1d87468ca01566460334
---
M README.md
M extension.json
M includes/api/ApiMobileView.php
3 files changed, 2 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/30/364230/1

diff --git a/README.md b/README.md
index d6f7a38..4569ab7 100644
--- a/README.md
+++ b/README.md
@@ -219,14 +219,6 @@
 * Type: `Boolean`
 * Default: `false`
 
-#### $wgMFTidyMobileViewSections
-
-Controls whether API `action=mobileview` should have every HTML section tidied
-for invalid markup.
-
-* Type: `Boolean`
-* Default: `true`
-
 #### $wgMFMobileHeader
 
 Requests containing header with this name will be considered as coming from
diff --git a/extension.json b/extension.json
index 1abf146..95c150e 100644
--- a/extension.json
+++ b/extension.json
@@ -1775,7 +1775,6 @@
                ],
                "MFSpecialCaseMainPage": false,
                "MinervaEnableSiteNotice": false,
-               "MFTidyMobileViewSections": true,
                "MFMobileHeader": "X-Subdomain",
                "MFRemovableClasses": {
                        "beta": [],
diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index bec4f2c..daa6ca4 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -495,7 +495,6 @@
         * @param string $html representing the entire page
         * @param Title $title
         * @param ParserOutput $parserOutput
-        * @param boolean $useTidy whether the provided HTML should be tidied 
(optional)
         * @param integer $revId this is a temporary parameter to avoid debug 
log warnings.
         *  Long term the call to wfDebugLog should be moved outside this 
method (optional)
         * @return array structure representing the list of sections and their 
properties:
@@ -505,9 +504,7 @@
         *  - text: [] of the text of each individual section. length === same 
as sections
         *      or of length 1 when there is a mismatch.
         */
-       protected function parseSectionsData( $html, Title $title, ParserOutput 
$parserOutput,
-               $useTidy = false, $revId = null
-       ) {
+       protected function parseSectionsData( $html, Title $title, ParserOutput 
$parserOutput, $revId = null ) {
                $data = [];
                $data['sections'] = $parserOutput->getSections();
                $sectionCount = count( $data['sections'] );
@@ -528,9 +525,6 @@
                foreach ( $chunks as $chunk ) {
                        if ( count( $data['text'] ) ) {
                                $chunk = "<h$chunk";
-                       }
-                       if ( $useTidy && count( $chunks ) > 1 ) {
-                               $chunk = MWTidy::tidy( $chunk );
                        }
                        if ( preg_match( '/<ol\b[^>]*?class="references"/', 
$chunk ) ) {
                                $data['refsections'][count( $data['text'] )] = 
true;
@@ -645,9 +639,7 @@
                                'refsections' => [],
                        ];
                } else {
-                       $useTidy = $this->getConfig()->get( 'TidyConfig' ) !== 
null
-                               && $mfConfig->get( 'MFTidyMobileViewSections' );
-                       $data = $this->parseSectionsData( $html, $title, 
$parserOutput, $useTidy, $latest );
+                       $data = $this->parseSectionsData( $html, $title, 
$parserOutput, $latest );
                        if ( $this->usePageImages ) {
                                $image = $this->getPageImage( $title );
                                if ( $image ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/364230
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c8f5437dc25eec8f1ea1d87468ca01566460334
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to