Excellent job, Brian!
Seems we have some overlap, which I'm sure is my fault because your plugin was around long before mine was (http://plugins.learningjquery.com/expander/ ). If only I had known before I got to work on mine... Oh well. It'll be fun to poke around the truncate plugin's code to see how similar our approaches were.
Cheers, --Karl _________________ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 11, 2008, at 12:22 PM, Giant Jam Sandwich wrote:
This has been a long time coming, and is a major update for the plugin. Previously, if you decided to truncate a string, it would strip all the HTML from that string. Essentially, it worked by slicing the string in two, and by hiding the second half. The new version uses a series of regular expressions, and maintains two copies of the string. I won't go into all the technical details, but I threw some pretty nasty HTML at it, and it seemed to work well. Empty HTML tags after the truncate will be removed, but any HTML closing tag after the truncate associated with an HTML opening tag before the truncate will remain. So if you truncated mid list item, formatting would still be maintained for the list. Give it a go, and let me know if you discover any bugs. Thanks! http://www.reindel.com/truncate/ Brian Reindel