Jdlrobson has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/404780 )
Change subject: Remove blacklisted content before applying transforms
......................................................................
Remove blacklisted content before applying transforms
Previously we removed all blacklisted elements before applying
transforms such as moving lead paragraph.
This is unnecessary and can lead to problems, for example infoboxes
inside elements which are to be removed, might be moved above the
lead paragraph and skip the blacklisting altogether. This also leads
to unnecessary logging when the move is not possible
HtmlFormatter::filterContent takes care of content removal so lets
do that before our transformations explicitly.
Bug: T185040
Change-Id: I18bc97fa37bdc53e61cb6de79fb6bc1158ffd9fe
---
M includes/MobileFormatter.php
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/80/404780/1
diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index 55429ba..0774271 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -183,6 +183,8 @@
$this->doRemoveImages();
}
+ // Apply all removals before continuing with transforms (see
T185040 for example)
+ $removed = parent::filterContent();
$transformOptions = [
'images' => $removeImages,
'references' => $removeReferences,
@@ -200,8 +202,7 @@
if ( $transformOptions['references'] ) {
$this->doRewriteReferencesLinksForLazyLoading( $doc );
}
-
- return parent::filterContent();
+ return $removed;
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/404780
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I18bc97fa37bdc53e61cb6de79fb6bc1158ffd9fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits