How to render text based on differences for human reading in javascript

I need to print the embedded text (code) differences in a format for human reading (for example: not optimized by the machine).

My platform is Javascript (main node.js, browser). I have my own printer / stylist, but I'm having trouble making the right diff changes.

It is important that human intuitive changes: such a strong bias towards changes in the line and very little on random fragmented letters.

Examples of non-JS renderers that look good are one of Tortoise SVN / GIT and diff renderer on github.com. I believe github reads the โ€œstandardโ€ patch format, but I'm sure there is one more logic to turn this into a rather complicated diff.

Some modules I tried:

, - , ( ..), , .

?

+4

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


All Articles