support MediaWikiServices::getInstance()->getTidy() on MW 1.36+

This commit is contained in:
Universal Omega 2021-05-27 20:55:53 -06:00 committed by GitHub
parent 98b0038c92
commit e02ed1ed13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,12 +16,16 @@ class MediaWikiParserService implements ExternalParser {
$this->frame = $frame;
if ( $wgPortableInfoboxUseTidy && class_exists( '\MediaWiki\Tidy\RemexDriver' ) ) {
if ( version_compare( MW_VERSION, '1.36', '>=' ) ) {
$this->tidyDriver = MediaWiki\MediaWikiServices::getInstance()->getTidy();
} else {
$this->tidyDriver = \MWTidy::factory( [
'driver' => 'RemexHtml',
'pwrap' => false
] );
}
}
}
/**
* Method used for parsing wikitext provided in infobox that might contain variables