jenkins-bot has submitted this change and it was merged. (
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 AFTER 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(-)
Approvals:
Pmiazga: Looks good to me, approved
jenkins-bot: Verified
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: merged
Gerrit-Change-Id: I18bc97fa37bdc53e61cb6de79fb6bc1158ffd9fe
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Pmiazga <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits