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:
evazion
2020-01-18 20:04:23 -06:00
parent b62cdc4cfe
commit c2688e3aff
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')}