Hi,
When I let the usage of HTML filters for posts (I tryed with book pages) the Preview trimmed version does not works if the post contains some HTML tag.
i.e.:
- set Length of trimmed posts = 200 characters.
- write a book page with this text:
row 1 row 1 row 1 row 1 row 1 row 1 row 1 row 1
row 2 row 2 row 2 row 2 row 2 row 2 row 2 row 2
row 3 row 3 row 3 row 3 row 3 row 3 row 3 row 3
row 4 row 4 row 4 row 4 row 4 row 4 row 4 row 4
row 5 row 5 row 5 row 5 row 5 row 5 row 5 row 5
And you will get the text up to the row 4 (right).
Now try with
row 1 row 1 row 1 row 1 row 1 row 1 row 1 row 1
<p>row 2 row 2 row 2 row 2 row 2 row 2 row 2 row 2</p>;
row 3 row 3 row 3 row 3 row 3 row 3 row 3 row 3
row 4 row 4 row 4 row 4 row 4 row 4 row 4 row 4
row 5 row 5 row 5 row 5 row 5 row 5 row 5 row 5
Also if the <p> is included in the Filtered HTML or if the Filtered HTML is set for Escape all tags you'll get the preview up to only the row 2.
I used <p> tag but also others tags give some problems, i.e. the <b> let the preview to write up to the row 3 (!?).
Comments
Comment #1
devbox commentedI see this problem in the function node_teaser() in this block that I don't understand the reason:
If I remove this block all seems to work correctly and the html code produced seems all right.
Comment #2
gpk commentedThe problem is to do with how newlines within $body are interpreted, and the fact that node_teaser() tries to break at the end of a complete paragraph, i.e. a <p> element, in preference to a line break. See http://drupal.org/node/155337 for more details and a patch that provides significant improvements to the behaviour you are experiencing. Also see http://api.drupal.org/api/function/node_teaser for description of what the function is trying to do.
Comment #3
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.