On 2/9/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 2/8/06, Milton Waddams <[EMAIL PROTECTED]> wrote: > > I'm wondering if anyone has a filter which safely truncates html so as > > not to chop through tags. > > Hey Milton, > > You could try using the Python interface to HTML Tidy: > > http://www.egenix.com/files/python/mxTidy.html
That was going to be along the lines of my solution if I didn't get a response :) I was going to use microdom (have had some trouble with html tidy in the past) and maybe some xpath, xsl or similar to sort out what is what. Am a little concerned about performance, if I'm truncating 50 stories per page then it may start hurting my server without caching.