Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
arevos CreditAttribution: arevos commentedIn the node_teaser function of node.module:
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:
Comment #2
Dries CreditAttribution: Dries commentedFixed in both the HEAD and the DRUPAL-4-3 branch. Consider submitting a real patch next time: it saves some time. Thanks.
Comment #3
(not verified) CreditAttribution: commented