Skip to content
bct edited this page Sep 13, 2010 · 1 revision

Proper XML tools deserve proper XML content. If you have Hpricot installed, atom-tools can convert HTML text elements to XHTML:

[:title, :content, :summary].each do |text_type|
  if entry.send(text_type) and entry.send(text_type)["type"] == "html"
    entry.send("#{text_type}=", entry.send(text_type).xml)
    entry.send(text_type)["type"] = "xhtml"
  end
end
Clone this wiki locally