mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 19:38:24 +00:00
26 lines
826 B
Ruby
26 lines
826 B
Ruby
# This class is used to generate diffs, it will be consumed by the UI on the client that displays diffs.
|
|
#
|
|
# There are potential performance issues associated with diffing large amounts of completely
|
|
# different text, see answer here for optimization if needed
|
|
# http://meta.stackoverflow.com/questions/127497/suggested-edit-diff-shows-different-results-depending-upon-mode
|
|
|
|
class DiffEngine
|
|
|
|
# Generate an html friendly diff
|
|
#
|
|
# returns: html containing decorations indicating the changes
|
|
def self.html_diff(html_before, html_after)
|
|
# tokenize
|
|
# remove leading/trailing common
|
|
# SES
|
|
# format diff
|
|
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
|