# Extracting discourse's text diffing functionality

**URL:** <https://meta.discourse.org/t/extracting-discourses-text-diffing-functionality/87236>\
**Category:** Development\
**Created:** [May 11, 2018, 5:07am UTC](https://meta.discourse.org/t/extracting-discourses-text-diffing-functionality/87236 "2018-05-11T05:07:10Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)\
**Post date:** [May 11, 2018, 5:07am UTC](https://meta.discourse.org/t/extracting-discourses-text-diffing-functionality/87236/1 "2018-05-11T05:07:10Z")

</div>

I’ve recently found myself with a need for Discourse’s excellent post diffing functionality in a project.

 ![45%20PM](https://global.discourse-cdn.com/meta/original/3X/7/3/73d698d1896ba4627dfaae58259a311f720f9fdd.png)

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:  
[https://www.github.com/gdpelican/discourse-diff](https://www.github.com/gdpelican/discourse-diff)

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 🙂 )

---

_[View the full topic](https://meta.discourse.org/t/extracting-discourses-text-diffing-functionality/87236)._
