mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
Merge "Use ParserOutput stateless transforms"
This commit is contained in:
commit
9d3194703f
|
@ -1156,7 +1156,9 @@ abstract class EchoDiscussionParser {
|
|||
*/
|
||||
static function getTextSnippet( $text, Language $lang, $length = 150, $title = null ) {
|
||||
// Parse wikitext
|
||||
$html = MessageCache::singleton()->parse( $text, $title )->getText();
|
||||
$html = MessageCache::singleton()->parse( $text, $title )->getText( [
|
||||
'enableSectionEditLinks' => false
|
||||
] );
|
||||
$plaintext = trim( Sanitizer::stripAllTags( $html ) );
|
||||
return $lang->truncate( $plaintext, $length );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue