tenderlove/nokogiri — pull request #635 by tomhughes (2012-03-17 15:46:15+00:00)
Title: Save original error handlers and restore them afterwards

Before installing a temporary error handler make sure any existing handler is saved and then restore it afterwards as other code may be using libxml and have installed error handlers.

In particular libxml-ruby installs a structured error handler which can then get wiped out by Nokogiri if you are trying to use both of them in the same process.