This is a inline html diffing engine forked off of Discourse. All credit goes to them :)
Add this line to your application's Gemfile:
gem 'discourse-diff'
And then execute:
$ bundle
Or install it yourself as:
$ gem install discourse-diff
Discourse::Diff.new("before text", "after text").inline_html
#
Discourse::Diff.new("before text", "after text").side_by_side_html
Discourse::Diff.new("before text", "after text").side_by_side_markdown
Bug reports and pull requests are welcome on GitHub at https://github.com/gdpelican/discourse-diff
The gem is available as open source under the terms of the MIT License.