I've tried to keep most of my suggestions to existing features in the spirit of "simple" feed, but I can think of one VERY useful enhancement that would make this module the "bomb." :-)

The current teaser function in drupal uses a strict character count to determine the teaser text. However, I find that many, many rss feeds embed a lot of html tags in their content. The teaser function sees the html as legit characters and ends up trimming the teaser to nothing but a few words sometimes. It also tends to leave bold and italic tags unresolved, which then screws up all the teasers underneath, in a listing.

What would be killer is a replacement teaser function that ignores html in calculating the teaser length and also resolves any hanging tags.

I know this is ambitious, but worthy of the attempt!

Comments

m3avrck’s picture

Status: Active » Closed (won't fix)

This is unfort how Drupal handles teasers (basically sucks).

You can create a hook_nodeapi, case submit, and drop in this code to fix 'em (this is what I use):

        // remove any HTML or line breaks so these don't appear in the teaser
        $teaser = trim(str_replace(array("\n", "\r"), ' ', strip_tags($node->body)));
        $teaser = trim(substr($teaser, 0, 248));
        $lastchar = substr($teaser, -1, 1);
        // check to see if the last character is a punctuation mark, if not add ellipsis
        if (!preg_match('/[\.\!\

/', $lastchar)) {
$teaser .= '...';
}
$node->teaser = $teaser;
?>

m3avrck’s picture

        // remove any HTML or line breaks so these don't appear in the teaser
        $teaser = trim(str_replace(array("\n", "\r"), ' ', strip_tags($node->body)));
        $teaser = trim(substr($teaser, 0, 248));
        $lastchar = substr($teaser, -1, 1);
        // check to see if the last character is a punctuation mark, if not add ellipsis
        if (!preg_match('/[\.\!\?]/', $lastchar)) {
          $teaser .= '...';
        }
        $node->teaser = $teaser;   
gpk’s picture

Subscribing