I’ve recently found myself with a need for Discourse’s excellent post diffing functionality in a project.
Normally for a project like this I’d take a look at Discourse’s code and re-implement it to my taste, but this time it struck me as an great library to extract (given that it’s self-contained and uses a computer-sciency algorithm with a fancy name and whatnot)
I’ve extracted it to a gem here:
Which is a straight port of the existing functionality, no fiddling necessary, for anyone else who might need such a thing.
(PS, more than happy to transfer ownership of this to the Discourse team if they want that, as long as I can keep using it )