Aeolun / react-diff-viewer-continued

A simple and beautiful text diff viewer component made with Diff and React.
https://aeolun.github.io/react-diff-viewer-continued/
MIT License
113 stars 34 forks source link

Suggestion: Having the option to use custom compare methods #41

Closed davidfan168 closed 3 months ago

davidfan168 commented 6 months ago

I am currently trying to compare a texts from html documents, and the default compare functions are not working too well for this case. Is it possible to add the option of using custom compare functions? This should also help with other requests like case insensitive diffs: https://github.com/Aeolun/react-diff-viewer-continued/issues/26

I found a pull request on the original react-diff-viewer which should just allow us to do this: https://github.com/praneshr/react-diff-viewer/pull/137/files

Will it be ok to add the changes from that commit? If it is then can I just create a pull request for that? I can also update the readme and provide examples on it. (Sorry for all these questions. This is my first time interacting with a public repo)

OneStepCloser commented 4 months ago

Totally agree, I was searching for this feature as well. We need this feature to have possibility to render a code without a diff, just like in a simple code viewer and switch dynamically into the diff mode on demand.

Aeolun commented 4 months ago

@davidfan168 If you want to take the changes from that commit and can add them to the current code to make it work, you are more than welcome to.

davidfan168 commented 3 months ago

Thanks! I'll start working on it over the weekend