The default rails XML builder escapes all HTML, so something like:
atom_feed do |feed|
@stories.each do |story|
feed.entry story do |entry|
entry.title story.title
entry.content "<b>foo</b>"
end
end
end
will produce the text:
<b>foo</b>
instead of: foo
Is there any way to instruct the XML builder to not escape the XML?
turns out you need to do
entry.content "<b>foo</b>", :type => "html"
althought wrapping it in a CDATA stops it working.
entry.content "type" => "html" do
entry.cdata!(post.content)
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With