Fix description truncation for <a> and <img>

Language::truncateForVisual() is for plain text strings, while
Language::truncateHTML() is, unsurprisingly, for HTML.

Bug: T32377
Change-Id: Ica171d7c87781801a6634abd6056880bf02f96f0
This commit is contained in:
BlankEclair 2024-07-05 19:30:10 +10:00
parent 2cd2cccdf2
commit cec3712651

View file

@ -443,7 +443,7 @@ class RSSParser {
break;
default:
$str = $this->escapeTemplateParameter( $item[$info] );
$str = $parser->getTargetLanguage()->truncateForVisual( $str, $this->ItemMaxLength );
$str = $parser->getTargetLanguage()->truncateHTML( $str, $this->ItemMaxLength );
$str = $this->highlightTerms( $str );
$renderedItem = str_replace( '{{{' . $info . '}}}',
$this->insertStripItem( $str ), $renderedItem );