diff-lcs

Make output of diff-lcs human readable

允我心安 提交于 2019-12-12 18:17:40
问题 I'm using the diff-lcs gem to output a difference between two bodies of html content. Here's the sample content. Version one: <p>Paragraph one. Sentence one.</p> <p>Paragraph two. Another sentence.</p> <p>Paragraph three. I dare you to change me!</p> Version two: <p>Paragraph one. Sentence two.</p> <p>Paragraph two. Another sentence.</p> <p>Paragraph three. I dare you to update me!</p> Using this: seq1 = @versionOne.body seq2 = @versionTwo.body seq = Diff::LCS.diff(seq1, seq2) You get this