diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php index dbf5b4427..28ed524b2 100644 --- a/includes/DiscussionParser.php +++ b/includes/DiscussionParser.php @@ -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 ); } diff --git a/includes/Formatters/EchoMentionInSummaryPresentationModel.php b/includes/Formatters/EchoMentionInSummaryPresentationModel.php index 52bf83e17..470ab181f 100644 --- a/includes/Formatters/EchoMentionInSummaryPresentationModel.php +++ b/includes/Formatters/EchoMentionInSummaryPresentationModel.php @@ -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' )