From: _why Date: 2006-11-23T04:24:31+09:00 Subject: Re: Hpricot/Rubyful Soup comparison On Thu, Nov 23, 2006 at 03:57:51AM +0900, Wes Gamble wrote: > Actually, I'm kind of hoping that I can make mods. to the parse tree, > but that no "unnecessary fixing" of bad HTML occurs. > > So I'm wondering does modifying the parse tree at all and then > outputting it imply that all of the malformed HTML will be > fixed/modified in some way or not? With `to_original_html`, no malformed HTML is fixed. >> require 'hpricot' >> doc = Hpricot("

Paragraph one

Paragraph two with some tags in it

") >> (doc/:p).set('class', 'new') >> puts doc.to_original_html

Paragraph one

Paragraph two with some tags in it

With `to_html`, Hpricot will line up all the tags. _why