Closed eGavr closed 10 years ago
It seems can't be implemented. Consider the following situation:
<span class="a
b"></span>
and
<span class="a b"></span>
How can we compare them line by line?
// cc @phrazer
I will think about it, and get back to you...
We can make switch to enable this only on big files, so smaller ones stays the same. Then we could first process both htmls with tidy -w 1000 option (it makes html 100% correct and gets every tag in separate line) and eliminate this problem. Then you just make line by line, then word by word, like we said on the beggining.
I used tidy on a lot of projects and it is really fast and never had problems with it... Its stable, been around long time.
tidy
is a nodejs module? Give me a link, please?
I can not understand, why do you need differ in tasks when you can find diffs without any tools? I tried to implement the idea of comparison by lines, but there are still so many diffs that jsdiff fails.
The problem discussed in #94
@phrazer proposed the following:
I had another idea, what if we first check line by line, and then if lines are the same go on, if not we also check word by word that line. Maybe then you get best from both worlds - speed and great diff tool. Just an idea, dont know if its possible to make it.