In the html-scanner used by ActionPack, the round-trip from text to HTML::Document back to text is currently broken on empty tag pairs:
>> HTML::Document.new("<tag></tag>").root.to_s => "<tag>"
It's easily fixed, and I submitted a patch:
http://dev.rubyonrails.org/ticket/7641
Any chance of applying this? Or let me know if it needs more work?
Thanks,
--Anthony.