Pryx / git-md-diff

A feature complete tool for managing documentations written in Markdown or MDX and generated via a specialized tool - e.g. Docusaurus
0 stars 0 forks source link

Try different libraries #7

Closed Pryx closed 3 years ago

Pryx commented 4 years ago

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:

Pryx commented 4 years ago

markdown-diff image

Pryx commented 4 years ago

@ads-vdh/md-diff image 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)...

Pryx commented 4 years ago

rich-text-diff image

Pryx commented 4 years ago

Google docs image

Pryx commented 4 years ago

Dubdiff image

Pryx commented 4 years ago

React-rich-diff image

Pryx commented 4 years ago

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.

Pryx commented 4 years ago

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.

Pryx commented 4 years ago

Modified markdown-diff with Google diff-match-patch library - first try No cleanup: image Semantic cleanup: image

This seems similar to the problem mentioned above. Might be just that more work is needed for it to be usable.

Pryx commented 4 years ago

image Looks like the diff is in fact correct... But it not being Markdown-aware causes those weird bugs...

Pryx commented 4 years ago

diff-match-patch word mode image

markdown-diff with JSDiff in Word mode image 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) image

Pryx commented 4 years ago

JSDiff sentences mode (= pretty much broken, not sure why) image

Pryx commented 4 years ago

Significant space (basically the same output as google diff-match-patch) image

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.

Pryx commented 3 years ago

Already selected markdown-diff JSDiff with Significant space mode, closing