Last modified: 2013-07-25 09:01:52 UTC
We need to introduce an optional parameter, and a default value to limit the number of characters. An implementation idea has been posted in 2010 on http://www.mediawiki.org/wiki/Extension_talk:RSS#How_to_modify_the_length_of_the_description.3F and is partially copied here: How to modify the length of the description? Something like this: preg_replace('/^(.{150}).{3,}(.{25})$/us', '$1 ... $2', $item['description']); Play around with the numbers and you'll see. --Subfader 21:48, 5 March 2010 (UTC) I changed rss.php a lot so I didn't check it, but it should work like this: Replace if ( $item['description'] ) { $text = trim( iconv( $charset, $wgOutputEncoding, $item['description'] ) ); with if ( $item['description'] ) { $shortdesc = preg_replace('/^(.{150}).{3,}(.{25})$/us', '$1 ... $2', $item['description']); $text = trim( iconv( $charset, $wgOutputEncoding, $shortdesc ) ); This will shorten the description text to [150 chars ... 25 chars]. --Subfader 19:15, 16 March 2010 (UTC)
added optional item-max-length attribute and $wgRSSItemMaxLength parameter. fixed in r111350 .
must reopen it, because I need to deactivate the itme string length limitation in controlled form for solving bug34763 in r113297. Rationale: Feed item string length limitation is difficult when we allow HTML <a> or <img> tags, because a mere content-unaware limitation breaks (can break) tags which results in disastrous rendering results. Solution will sought later,
Suggestion for implementation: https://www.mediawiki.org/wiki/User_talk:Wikinaut#Rss_truncating_results_when_using_html_13489 .
Gerrit change #3925
(In reply to comment #4) > Gerrit change #3925 Just a warning, the feed-item length limitation (part of my pending patch) is not finally solved, because a simple "blind" truncation to a certain number of characters can break HTMLs, which is undesired. This is just a warning, and I will work on that specific issue later (when the #3925 is merged). Thanks for your interests and adding a link to the https://gerrit.wikimedia.org/r/3925 .
(In reply to comment #5) > Just a warning, the feed-item length limitation (part of my pending patch) is > not finally solved, because a simple "blind" truncation to a certain number > of > characters can break HTMLs, which is undesired. This is just a warning, and I > will work on that specific issue later (when the #3925 is merged). T. Gries: Is there a followup bug or gerrit change for this? Closing this bug report as the corresponding Gerrit patch has been merged.
it is not solved yet. Please leave open.