lib/compare-xml.rb in compare-xml-0.61 vs lib/compare-xml.rb in compare-xml-0.62
- old
+ new
@@ -108,10 +108,16 @@
elsif n1.nil? || n2.nil?
status = MISSING_NODE
addDifference(n1, n2, n1, n2, opts, differences)
else
status = UNEQUAL_NODES_TYPES
- addDifference(n1, n2, n1, n2, opts, differences)
+ if n1.is_a? Nokogiri::XML::Text
+ addDifference(n1.parent, n2, n1, n2, opts, differences)
+ elsif n2.is_a? Nokogiri::XML::Text
+ addDifference(n1, n2.parent, n1, n2, opts, differences)
+ else
+ addDifference(n1, n2, n1, n2, opts, differences)
+ end
end
status
end
\ No newline at end of file