MaxSem has uploaded a new change for review.
https://gerrit.wikimedia.org/r/103725
Change subject: Experiment with disabling per-section tidy
......................................................................
Experiment with disabling per-section tidy
Introduce new variable, $wgMFTidyMobileViewSections, controlling per-section
tidy in action=mobileview. Default behavior remains the same, however we can
now experiment with it. Benefits include:
* Tidy sucks, make the world a better place without it
* It's slow - and since we can't afford caching every page, it affects
performance profoundly
* Divs across sections will look reasonably
Change-Id: I8a95e7442100fc597ed2f7ded8b587709585f7d9
---
M MobileFrontend.php
M includes/api/ApiMobileView.php
2 files changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/25/103725/1
diff --git a/MobileFrontend.php b/MobileFrontend.php
index 7c8b9de..39ee4c7 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -435,3 +435,8 @@
* Controls whether new 1-column diffs should be used
*/
$wgMFEnableBetaDiff = false;
+
+/**
+ * Controls whether API action=mobileview should have every HTML section
tidied for invalid markup
+ */
+$wgMFTidyMobileViewSections = true;
diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index d83aaeb..cb40697 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -273,7 +273,7 @@
}
private function getData( Title $title, $noImages ) {
- global $wgMemc, $wgUseTidy, $wgMFMinCachedPageSize;
+ global $wgMemc, $wgUseTidy, $wgMFTidyMobileViewSections,
$wgMFMinCachedPageSize;
wfProfileIn( __METHOD__ );
$wp = $this->makeWikiPage( $title );
@@ -353,7 +353,7 @@
if ( count( $data['text'] ) ) {
$chunk = "<h$chunk";
}
- if ( $wgUseTidy && count( $chunks ) > 1 ) {
+ if ( $wgUseTidy && $wgMFTidyMobileViewSections
&& count( $chunks ) > 1 ) {
wfProfileIn( __METHOD__ . '-tidy' );
$chunk = MWTidy::tidy( $chunk );
wfProfileOut( __METHOD__ . '-tidy' );
--
To view, visit https://gerrit.wikimedia.org/r/103725
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a95e7442100fc597ed2f7ded8b587709585f7d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits