htmldiff.net 1.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package htmldiff.net --version 1.4.0
NuGet\Install-Package htmldiff.net -Version 1.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="htmldiff.net" Version="1.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add htmldiff.net --version 1.4.0
#r "nuget: htmldiff.net, 1.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install htmldiff.net as a Cake Addin
#addin nuget:?package=htmldiff.net&version=1.4.0

// Install htmldiff.net as a Cake Tool
#tool nuget:?package=htmldiff.net&version=1.4.0

Overview

HTMLDiff.net library for comparing two HTML files/snippets and highlighting the differences using simple HTML.

This HTML Diff implementation is a C# port of the ruby implementation found "here":https://github.com/myobie/htmldiff.

Example:

var oldText = @"<p><i>This is</i> some sample text to <strong>demonstrate</strong> the capability of the <strong>HTML diff tool</strong>.</p>
                    <p>It is based on the <b>Ruby</b> implementation found <a href='http://github.com/myobie/htmldiff'>here</a>. Note how the link has no tooltip</p>
                    <p>What about a number change: 123456?</p>
                    <table cellpadding='0' cellspacing='0'>
                    <tr><td>Some sample text</td><td>Some sample value</td></tr>
                    <tr><td>Data 1 (this row will be removed)</td><td>Data 2</td></tr>
                    </table>
                    Here is a number 2 32
                    <br><br>
                    This date: 1 Jan 2016 is about to change (note how it is treated as a block change!)";

var newText = @"<p>This is some sample <strong>text to</strong> demonstrate the awesome capabilities of the <strong>HTML <u>diff</u> tool</strong>.</p><br/><br/>Extra spacing here that was not here before.
                    <p>It is <i>based</i> on the Ruby implementation found <a title='Cool tooltip' href='http://github.com/myobie/htmldiff'>here</a>. Note how the link has a tooltip now and the HTML diff algorithm has preserved formatting.</p>
                    <p>What about a number change: 123356?</p>
                    <table cellpadding='0' cellspacing='0'>
                    <tr><td>Some sample <strong>bold text</strong></td><td>Some sample value</td></tr>
                    </table>
                    Here is a number 2 <sup>32</sup>
                    <br><br>
                    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);
// 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));
var diffHtml = diffHelper.Build();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on htmldiff.net:

Package Downloads
SitecoreSidekickContentMigrator

Easily move production Sitecore content to pre-production environments with this Sidekick module.

SitecoreSidekickAuditLog

An app to graphically log and search author activity within Sitecore.

Blazorme.Diff

Diff component library for Blazor apps. It will render diff of the two input strings in different output display formats. It can also be used as a library to get diff or html diff output strings from code behind.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.2 15,770 10/27/2023
1.4.1 91,555 5/29/2023
1.4.0 1,117,876 5/23/2019
1.3.0 580,248 6/9/2016
1.2.0 24,385 2/3/2016
1.1.0 125,675 5/31/2012

Version 1.4 - dotnet standard2.0 support