mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Replace deprecated Linker::formatComment/formatLinksInComment
Bug: T324906 Change-Id: I8cd6ce852156d8c2c9e0da6218a62a2befe40ef3
This commit is contained in:
parent
4d44d4f900
commit
af15ecbc29
|
@ -1264,7 +1264,8 @@ abstract class EchoDiscussionParser {
|
|||
*/
|
||||
public static function getTextSnippetFromSummary( $text, Language $lang, $length = self::DEFAULT_SNIPPET_LENGTH ) {
|
||||
// Parse wikitext with summary parser
|
||||
$html = Linker::formatLinksInComment( Sanitizer::escapeHtmlAllowEntities( $text ) );
|
||||
$html = MediaWikiServices::getInstance()->getCommentFormatter()
|
||||
->formatLinks( Sanitizer::escapeHtmlAllowEntities( $text ) );
|
||||
$plaintext = trim( Sanitizer::stripAllTags( $html ) );
|
||||
return $lang->truncateForVisual( $plaintext, $length );
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace MediaWiki\Extension\Notifications\Formatters;
|
||||
|
||||
use Linker;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Revision\RevisionRecord;
|
||||
use Sanitizer;
|
||||
|
||||
|
@ -28,7 +28,8 @@ class EchoMentionInSummaryPresentationModel extends EchoEventPresentationModel {
|
|||
$revision = $this->event->getRevision();
|
||||
if ( $revision && $revision->getComment() && $this->userCan( RevisionRecord::DELETED_COMMENT ) ) {
|
||||
$summary = $revision->getComment()->text;
|
||||
$summary = Linker::formatComment( $summary );
|
||||
$summary = MediaWikiServices::getInstance()->getCommentFormatter()
|
||||
->format( $summary );
|
||||
$summary = Sanitizer::stripAllTags( $summary );
|
||||
|
||||
return $this->msg( 'notification-body-mention' )
|
||||
|
|
Loading…
Reference in a new issue