jsondiffpatch
jsondiffpatch copied to clipboard
Not all unchanged elements are presented in html formatter's diff
Let us compare json
[
[{"id": 1, "diff": "none"}, {"id": 2, "diff": "none"}],
[{"id": 1, "diff": "none"}, {"id": 2, "diff": "was"}]
]
with
[
[{"id": 2, "diff": "none"}, {"id": 1, "diff": "none"}],
[{"id": 2, "diff": "now"}, {"id": 1, "diff": "none"}]
]
That is, in first array we just swapped elements, while in the second one we also changed one of the elements. And now look to the screenshot how html formatter draws it when "show unchanged" option enabled.
In the first case it's ok, we can see unchanged element with id=1 and moved id=2. In the second case unchanged element is not present.
P.S. By the way, if one changes element with id=1 rather than id=2 diff would look even stranger (unexisting changes still related to id=2, like above):