MaxSem has uploaded a new change for review.
https://gerrit.wikimedia.org/r/127206
Change subject: Reorganize blacklisted selectors
......................................................................
Reorganize blacklisted selectors
* Remove WMF-specific classes already present in mediawiki-config
* Remove TOC via standard ParserOutput functions, it's faster this way
* Comment the remaining classes
Change-Id: Ic2479dbd842b910722114449d3465d9f1ce76078
---
M ApiQueryExtracts.php
M TextExtracts.php
2 files changed, 13 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TextExtracts
refs/changes/06/127206/1
diff --git a/ApiQueryExtracts.php b/ApiQueryExtracts.php
index 7178bdc..6462425 100644
--- a/ApiQueryExtracts.php
+++ b/ApiQueryExtracts.php
@@ -185,6 +185,7 @@
if ( $page->isParserCacheUsed( $this->parserOptions, 0 ) ) {
$pout = ParserCache::singleton()->get( $page,
$this->parserOptions );
if ( $pout ) {
+ $pout->setTOCEnabled( false );
$text = $pout->getText();
if ( $this->params['intro'] ) {
$text = $this->getFirstSection( $text,
false );
diff --git a/TextExtracts.php b/TextExtracts.php
index 5b6d23c..90eb0d4 100644
--- a/TextExtracts.php
+++ b/TextExtracts.php
@@ -49,8 +49,18 @@
* Selectors of content to be removed from HTML
*/
$wgExtractsRemoveClasses = array(
- '.toc', 'table', 'div', '.mw-editsection', 'sup.reference',
'span.coordinates',
- 'span.geo-multi-punct', 'span.geo-nondefault', '.noexcerpt', '.error',
'.nomobile',
+ // These usually represent content that is not part of usual text flow
+ 'table', 'div',
+ // Section edit links
+ '.mw-editsection',
+ // Extension:Cite references
+ 'sup.reference',
+ // Used by parser for various wikitext errors, no point having them in
extracts
+ '.error',
+ // Ignored in MobileFrontend. @todo: decide if it's really needed
+ '.nomobile',
+ // Class specifically for this extension
+ '.noexcerpt',
);
/**
--
To view, visit https://gerrit.wikimedia.org/r/127206
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2479dbd842b910722114449d3465d9f1ce76078
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TextExtracts
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits