Skip to content

Instantly share code, notes, and snippets.



Forked from tenderlove/omg.rb
Created Jan 6, 2011
What would you like to do?
require 'nokogiri'
doc = Nokogiri.HTML DATA
doc.xpath('//div//text()').map { |x| x.content = x.to_s }
p doc.serialize(:save_with => Nokogiri::XML::Node::SaveOptions::NO_DECLARATION)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment