in reply to Truncating HTML early

Slash (the code that runs Slashdot) has to do this often. For display in the main comment list, we truncate users' comments that exceed a certain length, and then have to close up all the tags and such.

This is done near the top of the dispComment() function, in Slash.pm. Basically, we call chopEntity() which truncates to a given size without interrupting an HTML entity; strip_html() which takes out any illegal HTML tags; then balanceTags() which rebalances everything. Those are all in Slash::Utility::Data.

You can ignore the </A> fixing and addDomainTags() since you won't be using that of course.

- Jamie