Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 640 Bytes

README.md

File metadata and controls

29 lines (19 loc) · 640 Bytes

HTMLDiff

Compare HTML and Markdown using inline or side-by-side diffs.

The code for this is extracted from Discourse. This just packages it as a standalone gem.

Installation

Add this line to your application's Gemfile:

gem 'html_diff', github: 'feedbin/html_diff'

Usage

require "html_diff"

# Generate inline HTML diff
HTMLDiff::Diff.new(before, after).inline_html

# Generate side-by-side HTML diff
HTMLDiff::Diff.new(before, after).side_by_side_html

# Generate side-by-side Markdown diff
HTMLDiff::Diff.new(before, after).side_by_side_markdown