Soenneker.Html.Formatter 4.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.Formatter --version 4.0.127
                    
NuGet\Install-Package Soenneker.Html.Formatter -Version 4.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.Formatter" Version="4.0.127" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Html.Formatter" Version="4.0.127" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Html.Formatter" />
                    
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.Formatter --version 4.0.127
                    
#r "nuget: Soenneker.Html.Formatter, 4.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.Formatter@4.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.Formatter&version=4.0.127
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Html.Formatter&version=4.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

Soenneker.Html.Formatter

Provides utilities for formatting, pretty-printing, normalizing, reading, and saving HTML content.

Install

dotnet add package Soenneker.Html.Formatter

Quick start

using Soenneker.Html.Formatter.Registrars;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();
var result = services.AddHtmlFormatterAsSingleton();

Adds IHtmlFormatter as a singleton service.

What you get

  • IHtmlFormatter — Provides utilities for formatting, pretty-printing, normalizing, reading, and saving HTML content.
  • HtmlFormatterRegistrar — A utility library that formats and normalizes HTML strings and files.

API at a glance

API What it does Result / important behavior
IHtmlFormatter.PrettyPrint(html, cancellationToken) Pretty-prints the specified HTML with indentation and readable formatting. The pretty-printed HTML.
IHtmlFormatter.Normalize(html, cancellationToken) Normalizes the specified HTML into a consistent serialized form without pretty-print indentation. The normalized HTML.
IHtmlFormatter.PrettyPrintFile(filePath, log, cancellationToken) Reads HTML from the specified file and pretty-prints it. The pretty-printed HTML.
IHtmlFormatter.NormalizeFile(filePath, log, cancellationToken) Reads HTML from the specified file and normalizes it. The normalized HTML.
IHtmlFormatter.SavePrettyPrintedFile(sourcePath, destinationPath, log, cancellationToken) Reads HTML from the source file, pretty-prints it, and saves the result. A task representing the asynchronous save operation.
IHtmlFormatter.SaveNormalizedFile(sourcePath, destinationPath, log, cancellationToken) Reads HTML from the source file, normalizes it, and saves the result. A task representing the asynchronous save operation.
IHtmlFormatter.PrettyPrintDirectory(directoryPath, recursive, log, cancellationToken) Formats all HTML files in the specified directory and saves the results in place. A task representing the asynchronous formatting operation.
HtmlFormatterRegistrar.AddHtmlFormatterAsSingleton(services) Adds IHtmlFormatter as a singleton service. The same service collection, so additional registrations can be chained.
HtmlFormatterRegistrar.AddHtmlFormatterAsScoped(services) Adds IHtmlFormatter as a scoped service. The same service collection, so additional registrations can be chained.

Practical notes

  • Cancellation stops pending work; it does not undo work that has already completed.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Html.Formatter:

Package Downloads
Soenneker.Playwrights.Crawler

A configurable Playwright crawler with rich stealth and control options.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.170 59 9/13/2026
4.0.169 34 9/13/2026
4.0.168 40 9/13/2026
4.0.167 42 9/13/2026
4.0.166 109 9/13/2026
4.0.165 39 9/12/2026
4.0.164 91 9/12/2026
4.0.163 39 9/12/2026
4.0.161 74 9/11/2026
4.0.160 182 9/9/2026
4.0.159 129 9/9/2026
4.0.158 142 9/8/2026
4.0.157 151 9/8/2026
4.0.156 120 9/8/2026
4.0.155 129 9/8/2026
4.0.154 150 9/7/2026
4.0.153 119 9/7/2026
4.0.152 120 9/7/2026
4.0.151 132 9/7/2026
4.0.127 179 8/29/2026
Loading failed