Any existing C # code (OSS) that will compute diff between two lines and html output?

I need to compare two lines and output diff in HTML (similar to changes in the MS Word track). The language is C #, it is (not surprisingly) a .NET web application. There are several similar questions (like this one for PHP / Python ), but there is no existing question about SO.

I do not need a finished project, just everything that cuts out the extra work. I know that this problem has been solved at least once. I am looking for leverage from this starting place (source for the object, just a method, just an algorithm in C #, everything will be useful). The output for diff must be in HTML.

+3
source share
2 answers

There is a C # class available from here (under the BSD license) that will distinguish between two text inputs. If you download the source code, there is also code that will turn this output into HTML. An example of its output can be found here .

+3
source

DiffPlex and Google Diff Match and Patch (via the prettyHtml function) are some other open source options.

+1
source

Source: https://habr.com/ru/post/1719895/


All Articles