问题
ruby-1.8.7-p249 > xml = Builder::XmlMarkup.new
=> <inspect/>
ruby-1.8.7-p249 > xml.foo '<b>wow</b>'
=> "<inspect/><foo><b>wow</b></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.
回答1:
Builder::XmlMarkup#<<
xml.foo do
xml << '<b>wow</b>'
end
来源:https://stackoverflow.com/questions/2693036/how-to-tell-builder-to-not-to-escape-values