From 47be98ed1c48034febab410ef518fd8b28317748 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Sat, 23 Feb 2013 16:30:02 +1100 Subject: [PATCH] diff engine, help needed --- lib/diff_engine.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/diff_engine.rb diff --git a/lib/diff_engine.rb b/lib/diff_engine.rb new file mode 100644 index 00000000000..37bbeea398b --- /dev/null +++ b/lib/diff_engine.rb @@ -0,0 +1,21 @@ +# This class is used to generate diffs, it will be consumed by the UI on +# on the client the displays diffs. +# +# Ruby has the diff/lcs engine that can do some of the work, the devil +# is in the details + +class DiffEngine + + # generate an html friendly diff similar to the way Stack Exchange generate + # html diffs + # + # retruns: html containing decorations indicating the changes + def self.html_diff(html_before, html_after) + end + + # same as html diff, except that it operates on markdown + # + # returns html containing decorated areas where diff happened + def self.markdown_diff(markdown_before, markdown_after) + end +end