From: 7stud -- Date: 2009-07-20T18:30:45+09:00 Subject: Re: Hpricot - strip out images and show first x words Max Williams wrote: > 7stud -- wrote: > >> Well, what does this say: >> >>> I have a bunch of html in p tags and i want to show shorted >>> summary - like the first 25 words followed by '...'. > I guess that was a bit ambiguous, sorry. Anyway, i'm interested to see > you don't think it's worth bothering with hpricot in this case, and just > use a regex - i was wondering if hpricot was overkill myself. > > One problem that just occurred to me is that treating the whole html > like text and taking the first 25 words will make it into invalid html - > because we have start tags with no matching end tags. > I stopped using Hpricot because you said this was your desired output: >> post.lede => "

From the UKTI blog:

Early on 20 January 2009, nine British new media innovators and I arrived at the Foreign Office for a meeting ..." -- Posted via http://www.ruby-forum.com/.