Pool versions diff: Use diff builder to highlight description changes

- Add highlights for name changes
- Separate and name the sections
This commit is contained in:
BrokenEagle
2020-01-07 00:19:24 +00:00
parent 4ab90e5d6e
commit 34542fdf5c
3 changed files with 46 additions and 11 deletions

View File

@@ -18,4 +18,9 @@ module PoolVersionsHelper
status += ["Deactivated"] if !cur.is_active? && prev.is_active?
status.join(" ")
end
end
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
end
end