Merge "Replace use of deprecated MWTidy class"

This commit is contained in:
jenkins-bot 2021-10-26 04:53:31 +00:00 committed by Gerrit Code Review
commit 91afe58671
2 changed files with 3 additions and 3 deletions

View file

@ -4,7 +4,7 @@
"Max Semenik" "Max Semenik"
], ],
"requires": { "requires": {
"MediaWiki": ">= 1.35.0" "MediaWiki": ">= 1.36.0"
}, },
"url": "https://www.mediawiki.org/wiki/Extension:TextExtracts", "url": "https://www.mediawiki.org/wiki/Extension:TextExtracts",
"descriptionmsg": "textextracts-desc", "descriptionmsg": "textextracts-desc",

View file

@ -2,7 +2,7 @@
namespace TextExtracts; namespace TextExtracts;
use MWTidy; use MediaWiki\MediaWikiServices;
/** /**
* This class needs to understand HTML as well as plain text. It tries to not break HTML tags, but * This class needs to understand HTML as well as plain text. It tries to not break HTML tags, but
@ -102,7 +102,7 @@ class TextTruncator {
*/ */
private function tidy( $text ) { private function tidy( $text ) {
if ( $this->useTidy ) { if ( $this->useTidy ) {
$text = MWTidy::tidy( $text ); $text = MediaWikiServices::getInstance()->getTidy()->tidy( $text );
} }
return trim( $text ); return trim( $text );