var oldText = @"This is some sample text to demonstrate the capability of the HTML diff tool.
It is based on the Ruby implementation found here. Note how the link has no tooltip
What about a number change: 123456?
| Some sample text | Some sample value |
| Data 1 (this row will be removed) | Data 2 |
Here is a number 2 32
This date: 1 Jan 2016 is about to change (note how it is treated as a block change!)";
var newText = @"This is some sample text to demonstrate the awesome capabilities of the HTML diff tool.
Extra spacing here that was not here before.
It is based on the Ruby implementation found here. Note how the link has a tooltip now and the HTML diff algorithm has preserved formatting.
What about a number change: 123356?
| Some sample bold text | Some sample value |
Here is a number 2 32
This date: 22 Feb 2017 is about to change (note how it is treated as a block change!)";
var diffHelper = new HtmlDiff.HtmlDiff(oldText, newText);
litOldText.Text = oldText;
litNewText.Text = newText;
// Lets add a block expression to group blocks we care about (such as dates)
diffHelper.AddBlockExpression(new Regex(@"[\d]{1,2}[\s]*(Jan|Feb)[\s]*[\d]{4}", RegexOptions.IgnoreCase));
litDiffText.Text = diffHelper.Build();