Comments (8)
I tried to reproduce this with no success. Can you post the exact strings you
are trying to diff with HtmlTestFixture.java ?
Also you could always do some pre-preprocessing before passing the input
strings to DaisyDiff. I am actually using : input = input.replaceAll(" "," ");
in production code. Maybe this might solve your problem as well.
Original comment by [email protected]
on 10 Aug 2010 at 3:20
from daisydiff.
The code that I am using is:
HtmlTestFixture d = new HtmlTestFixture();
String one = "<p>Style sheets represent a major breakthrough for \n Web page designers,expanding their ability to improve the appearance of their pages. </p>";
String two = "<p>Style sheets represent a major breakthrough for Web page designers,expanding their ability to improve the appedfarance oops i am new of their . </p>";
String result = d.diff(one, two);
System.out.println(result);
And the output I get is:
<?xml version="1.0" encoding="UTF-8"?><p>Style sheets represent a major
breakthrough forááá Web page designers,expanding their ability to improve
the <span class="diff-html-removed" id="removed-diff-0" previous="first-diff"
changeId="removed-diff-0" next="added-diff-0">appearance </span><span
class="diff-html-added" id="added-diff-0" previous="removed-diff-0"
changeId="added-diff-0" next="removed-diff-1">appedfarance oops i am new
</span>of their <span class="diff-html-removed" id="removed-diff-1"
previous="added-diff-0" changeId="removed-diff-1" next="last-diff">pages</span>
. </p>
which is almost perfect except for the á characters instead of
input = input.replaceAll(" "," "); will not solve the problem as you will lose
the data about how much space is present between two words or sections unless
the text is between quotes.
Original comment by [email protected]
on 11 Aug 2010 at 5:50
from daisydiff.
3 points.
1. I tried your example with HtmlTestFixture and got normal spaces (not nsbp
but not strange characters either).
2. The HtmlTestFixture is very simple (just for unit tests). For production
quality code I would advise you to look at the main method that performs
several other cleanups. Normal DaisyDiff does exactly what you want (see
attached screenshot)
3. Can you clarify what data is lost by the "replaceAll" method? In your
example if I run this method then I still have the information that 3 spaces
exist before newline. What data is lost? What is the difference if the text
is in quotes or not?
Original comment by [email protected]
on 16 Aug 2010 at 1:07
Attachments:
from daisydiff.
I really dont understand how this is working at you end..could be a JVM issue?
May be I could try some other code as you suggested..
What I meant by you cant use input.replaceAll(" "," ") can be explained by
viewing the below code in a browser.
<p>hello how are you</p>
<p>hello how are you</p>
The output will be the same.
Original comment by [email protected]
on 16 Aug 2010 at 3:56
from daisydiff.
I had the same issue with the
In my case, htmldiff was replacing the correctly to ' ', in UTF-8. On the
other hand, my browser was configured to char encoding != UTF-8.
Solution: configure your browser char encoding to UTF-8.
Original comment by [email protected]
on 19 Nov 2010 at 7:52
from daisydiff.
dominic, can you check your browser settings?
Maybe what mcdoctore is suggesting is a solution?
Original comment by [email protected]
on 19 Nov 2010 at 3:19
from daisydiff.
It is working now..Thanks
Original comment by [email protected]
on 19 Nov 2010 at 4:30
from daisydiff.
Closed since it was apparently a browser issue.
Original comment by [email protected]
on 20 Nov 2010 at 10:51
- Changed state: Done
from daisydiff.
Related Issues (20)
- Add location of css and js directories as a commandline option HOT 1
- Indentation goes crazy when you compare two html pages having lot of numbered lists HOT 2
- Indentation goes crazy when you compare two html pages having lot of numbered lists HOT 4
- Alternative jQuery UI for Diff results
- Daisydiff fails to process certain invalid HTML files HOT 9
- DOM structure is modified in the daisydiff output HOT 5
- Unit test fails due to a missing newline character HOT 2
- Empty IMG tag throws NullPointerException
- when we comparing the two files have no change, daisy diff throwing Uncaught unknown destination..
- Does not Diff <Title> or <Meta> or <JavaScript> in HTML HOT 3
- An element that was moved out of a table can lead to broken table elements in the diff HOT 1
- Invalid tags are generated HOT 2
- Word changed but showing removed and added & change in image showing improper in Chrome. HOT 1
- error on line 6 at column 8: Opening and ending tag mismatch: link line 0 and head HOT 8
- [deleted issue]
- Compare result error for table
- [deleted issue]
- TextNode->IsSame() references not declared variable $html2 in php
- Is it possible to display the new created content? Not display the whole line.
- Xerces Impl included in daisydiff.jar has security vulnerabilities
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daisydiff.