gdpelican has extracted Discourse’s post diffing functionality into a gem called discourse-diff. This extraction is a straight port of the existing functionality and is available for others to use. zogstrip suggested that any updates or fixes should be considered for a pull request to the Discourse core. sam noted that the gem should technically be GPL-licensed, but the Discourse team is willing to waive this and allow the extraction to be MIT-licensed on a case-by-case basis. gdpelican acknowledged this and will clear any similar extractions with the team in the future.
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)
Note, strictly the gem should be GPL, but we are OK to waive that and allow this particular extraction to be MIT (similar to how onebox is MIT). Please note you need to clear this kind of stuff with us on a case-by-case basis.
Ah yes, that was my intention in creating this post was to make sure you were aware it existed and could make adjustments to it as you saw fit; I was following onebox’s lead on licensing as the only other gem I knew of that was extracted from core.
I’ll be sure to check in specifically if this situation comes up again