bsovers / daisydiff

Automatically exported from code.google.com/p/daisydiff
0 stars 0 forks source link

DOM structure is modified in the daisydiff output #47

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Create 2 very simple files and diff them (files attached, but also given here 
due to their simplicity; each line is its own file):
<p>foo</p><p>bar</p>
<p>foo</p><p>baz</p>

What is the expected output? What do you see instead?

The expected output would be to find the first P tag copied verbatim (as there 
have been no changes in it) and some diff markup in the second P tag. Instead, 
both P tags contain diff markup tags - daisydiff claims that the string bar was 
removed from the FIRST p and inserted into the second one (when it was in fact 
removed from the SECOND one).

What version of the product are you using? On what operating system?
Tried both daisydiff 1.2 as well as latest SVN trunk version. OpenJDK 1.6.0_24 
on OpenSUSE.

Please provide any additional information below.
I'm trying to instruct daisydiff to ignore certain trivial changes via 
appropriate XSL templates and this bug is getting in my way.

Original issue reported on code.google.com by gre...@gmail.com on 27 Aug 2012 at 10:50

Attachments:

GoogleCodeExporter commented 8 years ago
After further examination I've discovered that pre-1.2 versions of DaisyDiff 
didn't make this mistake, though their output was less than ideal: the first P 
tag of the above example would correctly remain untouched but the second P 
would be present twice in the diff output, once for the removal of bar and once 
for the addition of baz.

Original comment by gre...@gmail.com on 27 Aug 2012 at 11:32

GoogleCodeExporter commented 8 years ago
I've been doing a little debugging & guessing: it seems this bug only appears 
if the element with the difference doesn't have any elements with text in front 
of it; for example, with the input files being:

<div><span>a</span><p>foo</p><p>bar</p></div>
<div><span>a</span><p>foo</p><p>baz</p></div>

..the output is OK.

Original comment by gre...@gmail.com on 31 Aug 2012 at 11:51

GoogleCodeExporter commented 8 years ago
If I remove that a out, e.g. 

<div><span></span><p>foo</p><p>baz</p></div>

..then the result is invalid again.

Original comment by gre...@gmail.com on 31 Aug 2012 at 11:52

GoogleCodeExporter commented 8 years ago
Finally figured out the cause of this issue: it is the 'fix' for issue 46 I 
have applied on my own code. Please mark this as an invalid bug.

Sorry if I have wasted anybody's time.

Original comment by gre...@gmail.com on 31 Aug 2012 at 2:03

GoogleCodeExporter commented 8 years ago

Original comment by kkape...@gmail.com on 31 Aug 2012 at 3:00