In the node_teaser function of node.module:

  if ($length = strpos($body, "</p>", $size)) {
    return substr($body, 0, $length);
  }

This will chop off the ending "</p>" of a teaser paragraph, which isn't really desirable under any circumstances I can think of. If the user put a </p> to end a paragraph, then s/he probably wants it kept there.

Perhaps, instead:

  if ($length = strpos($body, "</p>", $size)) {
    return substr($body, 0, ($length + 4));
  }

Comments

arevos’s picture

Component: other » node.module
Assigned: arevos » Unassigned

In the node_teaser function of node.module:

  if ($length = strpos($body, "", $size)) {
    return substr($body, 0, $length);
  }

This will chop off the ending "</p>" of a teaser paragraph, which isn't
really desirable under any circumstances I can think of. If the user
put a </p> to end a paragraph, then s/he probably wants it kept there.

Perhaps, instead:

  if ($length = strpos($body, "", $size)) {
    return substr($body, 0, ($length + 4));
  }
Dries’s picture

Assigned: Unassigned » Dries

Fixed in both the HEAD and the DRUPAL-4-3 branch. Consider submitting a real patch next time: it saves some time. Thanks.

Anonymous’s picture