Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell Builder to not to escape values

ruby-1.8.7-p249 > xml = Builder::XmlMarkup.new
 => <inspect/> 
ruby-1.8.7-p249 > xml.foo '<b>wow</b>'
 => "<inspect/><foo>&lt;b&gt;wow&lt;/b&gt;</foo>" 
ruby-1.8.7-p249 > 

Builder is escaping the content and is converting the b tag into an escaped value. How do I tell Builder to not escape it? I am using Ruby 1.8.7.

like image 476
Nick Vanderbilt Avatar asked Apr 22 '10 17:04

Nick Vanderbilt


1 Answers

Builder::XmlMarkup#<<

xml.foo do
  xml << '<b>wow</b>'
end
like image 96
Alex Wayne Avatar answered Nov 16 '22 13:11

Alex Wayne