Tidy HTML output with JavaScript
You can try the cutter.js library. It's pretty new, so I haven't heard much about it, but it seems like what you're looking for as far as cropping goes.
Check out my fiddle, testing it out: http://jsfiddle.net/JKirchartz/jwL8v/
var oElement = document.getElementById("test");
Cutter.run(oElement, oElement, 100);
$("#gc").click(function(){
/* This will count words by spaces in the text */
var tt = $("#test").text().split(" ");
if (typeof(console) == 'object'){
console.log(tt);
}
alert("wordcount: "+tt.length);
});