Fix #4263: Wiki page differences use the wrong order.
Standardize DiffBuilder to treat the first argument as the new item and the second argument as the old item. This is the order used in most other places.
This commit is contained in:
@@ -21,6 +21,6 @@ module PoolVersionsHelper
|
||||
|
||||
def pool_page_diff(pool_version, other_version)
|
||||
pattern = Regexp.new('(?:<.+?>)|(?:\w+)|(?:[ \t]+)|(?:\r?\n)|(?:.+?)')
|
||||
DiffBuilder.new(other_version.description, pool_version.description, pattern).build
|
||||
DiffBuilder.new(pool_version.description, other_version.description, pattern).build
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ class DiffBuilder
|
||||
otharr = that_text.scan(pattern)
|
||||
|
||||
cbo = Diff::LCS::ContextDiffCallbacks.new
|
||||
diffs = thisarr.diff(otharr, cbo)
|
||||
diffs = otharr.diff(thisarr, cbo)
|
||||
|
||||
escape_html = ->(str) {str.gsub(/&/, '&').gsub(/</, '<').gsub(/>/, '>')}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user