prettydiff icon indicating copy to clipboard operation
prettydiff copied to clipboard

Feature Request : Classify differences for html in 3 categories - attributes/text/subtree

Open nitinsurana opened this issue 6 years ago • 1 comments

This needs more thought, but every difference in html can be classified into a few categories, namely - text/tag/attribute. Just like jsondiff.com, show a summary on the top, which displays the count for every type of difference and gives the ability to show/hide those differences.

nitinsurana avatar Jun 06 '19 23:06 nitinsurana

I am not currently performing language specific comparisons. I am performing all the language specific tasks and simply comparing the string results.

What I should be doing is comparing the parse trees, because then you can have exactly the data you are looking for regardless of the language. The big limitation with this is that parse trees are much harder to read than the formatted code output. I would need to think of a way to do this:

  1. format the code
  2. compare the parse trees and not the formatted output
  3. normalize the parse tree differences onto the formatted output

The first step requires no additional effort and the second step might be changing two lines of code. The third step might take some machine learning. I will have to think through this. Once I really nail it the solution should scale automatically without much maintenance.

This is a good, but very ambitious, feature request if executed correctly.

prettydiff avatar Jun 07 '19 06:06 prettydiff