Revisions differences #12166
-
Is there a way to get differences between 2 revisions like you get with WhatChanged() method? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There is no API for that. The Studio is able to do that, but it is doing this inline. By fetching the two revisions and comparing their texts. I would recommend that you take the same approach here. Just fetch the two documents, output their json with formatting enabled and then use any text diff tooling. Alternatively, you can get the two revisions and pass them to a library that would compare them. That is just the first I found, no idea about its quality. |
Beta Was this translation helpful? Give feedback.
-
You can also leverage session's tracking of changes
|
Beta Was this translation helpful? Give feedback.
There is no API for that. The Studio is able to do that, but it is doing this inline. By fetching the two revisions and comparing their texts.
I would recommend that you take the same approach here. Just fetch the two documents, output their json with formatting enabled and then use any text diff tooling.
Alternatively, you can get the two revisions and pass them to a library that would compare them.
An example of such a library is here:
https://github.com/GregFinzer/Compare-Net-Objects
That is just the first I found, no idea about its quality.