Skip to content

Logging elements and attributes removed

Jason Barnabe edited this page Jul 8, 2014 · 1 revision

This code will output the elements and attributes that are removed by Sanitize.

module NodeExtensions
	def unlink
		puts self.to_html
		super
	end
end

module Nokogiri
	module XML
		class Node
			prepend NodeExtensions
		end
	end
end

# do your sanitize stuff here