mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TextExtracts
synced 2024-11-24 00:04:35 +00:00
Merge "Replace use of deprecated MWTidy class"
This commit is contained in:
commit
91afe58671
|
@ -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",
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
Loading…
Reference in a new issue