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,10 +16,14 @@ class MediaWikiParserService implements ExternalParser {
$this->frame = $frame; $this->frame = $frame;
if ( $wgPortableInfoboxUseTidy && class_exists( '\MediaWiki\Tidy\RemexDriver' ) ) { if ( $wgPortableInfoboxUseTidy && class_exists( '\MediaWiki\Tidy\RemexDriver' ) ) {
$this->tidyDriver = \MWTidy::factory( [ if ( version_compare( MW_VERSION, '1.36', '>=' ) ) {
'driver' => 'RemexHtml', $this->tidyDriver = MediaWiki\MediaWikiServices::getInstance()->getTidy();
'pwrap' => false } else {
] ); $this->tidyDriver = \MWTidy::factory( [
'driver' => 'RemexHtml',
'pwrap' => false
] );
}
} }
} }