Workaround Nokogiri canonicalization issues in JRuby