I want to shorten comments with long text and add a "... [show full post]" behind the cut text to expand the full post. Since long comments on my site usually are lists it may be the best to cut them after e.g. 5 rows inside the comment div, but without breaking the html, i.e. the p tag.
<html>
<head>
<style type="text/css">
body {font-family:sans-serif; font-size:0.8em}
.comments {border:1px solid #aaa; padding:5px; margin-bottom:10px}
.commenttop {background-color:#f9f9f9; padding:5px}
.username {float:left; margin-right:10px; font-weight:bold}
.commentpost {padding:0 5px}
</style>
<script type="text/javascript">
</script>
</head>
<body>
<div class="comments">
<div class="commenttop"><div class="username">User 1</div>
<div class="date">12:12, 28 October 2010 (CEST)</div></div>
<div class="commentpost">
<p>Very long comment here<br />
<br />
Text in row 3<br />
Text in row 4<br />
Text in row 5<br />
Text in row 6<br />
Text in row 7<br />
Text in row 8<br />
Text in row 9<br />
Text in row 10<br />
Text in row 11<br />
Text in row 12
</p>
</div></div>
<div class="comments">
<div class="commenttop"><div class="username">User 2</div>
<div class="date">17:22, 30 October 2010 (CEST)</div></div>
<div class="commentpost">
<p>Text in row 1<br />
Text in row 2
</p>
</div></div>
</body>
</html>
In this example the result should be
Very long comment here
Text in row 3
Text in row 4
Text in row 5 ... show full post
Any idea how to do that? Thanks in advance!