Fix buglet in xhtmldiff
Fixes one of two formely broken unit tests.
This commit is contained in:
parent
ad049bcc4b
commit
3929fceaf8
2 changed files with 15 additions and 8 deletions
3
vendor/plugins/xhtmldiff/lib/xhtmldiff.rb
vendored
3
vendor/plugins/xhtmldiff/lib/xhtmldiff.rb
vendored
|
@ -7,6 +7,7 @@
|
|||
# Tweaks by Jacques Distler <distler@golem.ph.utexas.edu>
|
||||
# -- add classnames to <del> and <ins> elements added by XHTMLDiff,
|
||||
# for better CSS styling
|
||||
# -- detect change in element name, without change in content
|
||||
|
||||
require 'diff/lcs'
|
||||
require 'rexml/document'
|
||||
|
@ -64,7 +65,7 @@ class XHTMLDiff
|
|||
if a == b
|
||||
return a.deep_clone
|
||||
end
|
||||
if REXML::HashableElementDelegator === a and REXML::HashableElementDelegator === b
|
||||
if REXML::HashableElementDelegator === a and REXML::HashableElementDelegator === b and a.name == b.name
|
||||
o = REXML::Element.new(a.name)
|
||||
o.add_attributes a.attributes
|
||||
hd = self.new(o)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue