Soenneker.Html.Normalizer 11.0.127

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Html.Normalizer --version 11.0.127
                    
NuGet\Install-Package Soenneker.Html.Normalizer -Version 11.0.127
                    
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="Soenneker.Html.Normalizer" Version="11.0.127" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Html.Normalizer" Version="11.0.127" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Html.Normalizer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Html.Normalizer --version 11.0.127
                    
#r "nuget: Soenneker.Html.Normalizer, 11.0.127"
                    
#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.
#:package Soenneker.Html.Normalizer@11.0.127
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Html.Normalizer&version=11.0.127
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Html.Normalizer&version=11.0.127
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Html.Normalizer

Deterministic, configurable HTML normalization for hashing and change detection.

Installation

dotnet add package Soenneker.Html.Normalizer
```bash

## Usage

```csharp
using Soenneker.Html.Normalizer.Models;

HtmlNormalizationResult result = await normalizer.NormalizeAndHash(renderedHtml);

Console.WriteLine(result.Html);
Console.WriteLine(result.Hash);

The default profile removes common runtime artifacts while preserving indexable content:

  • HTML comments
  • <style> elements
  • scripts other than application/ld+json
  • nonce attributes
  • Blazor _bl_* element-reference attributes
  • element IDs and common HTML/ARIA attributes that reference them
  • formatting-only inter-element whitespace

It also normalizes line endings and sorts ordinary HTML attributes. Hashing uses XXH3 through Soenneker.Hashing.XxHash, producing a lowercase 64-bit hexadecimal hash for fast, non-adversarial change detection.

Application-specific normalization

using System.Text.RegularExpressions;
using Soenneker.Html.Normalizer.Options;

var options = new HtmlNormalizationOptions();

options.RemoveSelectors.Add("[data-runtime-only]");
options.RemoveAttributes.Add("data-request-id");
options.Replacements.Add(new HtmlNormalizationReplacement(
    "session-[a-f0-9]{32}",
    "session-id",
    RegexOptions.IgnoreCase | RegexOptions.CultureInvariant));

string normalized = await normalizer.Normalize(renderedHtml, options);

Dependency injection

using Soenneker.Html.Normalizer.Registrars;

services.AddHtmlNormalizerAsSingleton();
// or services.AddHtmlNormalizerAsScoped();

Browser readiness is intentionally outside this package. Wait for hydration or another application-specific readiness signal before capturing and normalizing rendered HTML.

Normalized output is for comparison, not for rendering back to users: the default profile removes IDs and ID-reference attributes that can be functionally or accessibility significant. Disable the corresponding options when those values are part of the change you need to detect.

String-based replacements use a one-second regex match timeout. When supplying an existing Regex, construct it with an appropriate timeout yourself. XXH3 is a fast non-cryptographic hash; do not use it for signatures, password storage, or authenticity checks.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.130 0 11/7/2026
11.0.129 114 11/3/2026
11.0.128 75 11/3/2026
11.0.127 75 11/3/2026
11.0.126 81 11/3/2026
11.0.125 89 11/2/2026
11.0.124 100 10/31/2026
11.0.123 113 10/27/2026
11.0.122 98 10/26/2026
11.0.118 86 10/26/2026
11.0.117 93 10/26/2026
11.0.116 90 10/26/2026
11.0.115 85 10/26/2026
11.0.114 92 10/26/2026
4.0.112 94 10/26/2026
4.0.111 163 10/15/2026
4.0.110 102 10/15/2026
4.0.109 100 10/15/2026
4.0.108 104 10/14/2026
4.0.107 96 10/14/2026
Loading failed

Updated Multiple NuGet packages