Closed Pryx closed 3 years ago
markdown-diff
@ads-vdh/md-diff
Note: This might look the best yet, but it is not - the diff is in fact incorrect - There is As
before What you'll learn
that shouldn't be there and What you'll learn
is not heading in this output (and more)...
rich-text-diff
Google docs
Dubdiff
React-rich-diff
Looks like the best option would be Dubdiff as the library provides easily readable format. What is bad about this library is that it doesn't support tables at all. That shouldn't be a problem for now, but is something to keep in mind that would need to be implemented later. It is not a proper library, so the code would need to be extracted, which hopefully shouldn't be a big problem. We could even try to use its server to kickstart development of the web app.
Second good option seems @ads-vdh/md-diff
- there is the problem with incorrect diff, but that could be easily fixable as there doesn't seem to be much code.
Modified markdown-diff with Google diff-match-patch library - first try No cleanup: Semantic cleanup:
This seems similar to the problem mentioned above. Might be just that more work is needed for it to be usable.
Looks like the diff is in fact correct... But it not being Markdown-aware causes those weird bugs...
diff-match-patch word mode
markdown-diff with JSDiff in Word mode This output is slightly incorrect because it includes text that should not be in header
Significant space (basically the same output as google diff-match-patch)
JSDiff sentences mode (= pretty much broken, not sure why)
Significant space (basically the same output as google diff-match-patch)
Trying to implement something among the lines of semantic cleanup (we could probably simply merge the added and removed parts if they are right after eachother) based on this kind of output might be a good idea.
Already selected markdown-diff JSDiff with Significant space mode, closing
Current library for local MD Diff gives correct results that are not really human-readable. We should try different libraries and find out whether any of them output diff that is more human-oriented :slightly_smiling_face: