From: Ned Konz Date: 2002-06-30T02:38:38+09:00 Subject: Re: htmltools and (un)escaped entities On Saturday 29 June 2002 10:21 am, Massimiliano Mirra wrote: > The snippet above outputs this: > > > John > & > Mary > > Is there a way to keep the ampersand (or entities in general) > unescaped, so that it will still print a '&'? require 'html/stparser' require 'html/element' class MyParser < HTML::StackingParser def handle_cdata(data) print data end def handle_entityref(name) print "&#{name};" end end p = MyParser.new p.feed("John & Mary") $ ruby test.rb John & Mary$ -- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE