2013-02-26 00:42:20 +08:00
|
|
|
# This class is used to generate diffs, it will be consumed by the UI on
|
2013-02-23 13:30:02 +08:00
|
|
|
# on the client the displays diffs.
|
|
|
|
#
|
2013-02-26 00:42:20 +08:00
|
|
|
# Ruby has the diff/lcs engine that can do some of the work, the devil
|
2013-02-23 13:30:02 +08:00
|
|
|
# is in the details
|
|
|
|
|
|
|
|
class DiffEngine
|
2013-02-26 00:42:20 +08:00
|
|
|
|
2013-02-23 13:30:02 +08:00
|
|
|
# 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
|