Soenneker.Html.Formatter
4.0.128
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Soenneker.Html.Formatter --version 4.0.128
NuGet\Install-Package Soenneker.Html.Formatter -Version 4.0.128
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.128" />
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.128" />
<PackageReference Include="Soenneker.Html.Formatter" />
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.128
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Html.Formatter, 4.0.128"
#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.128
#: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.128
#tool nuget:?package=Soenneker.Html.Formatter&version=4.0.128
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions 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.
-
net10.0
- Soenneker.AngleSharp.Parser (>= 4.0.59)
- Soenneker.Utils.Directory (>= 4.0.902)
- Soenneker.Utils.File (>= 4.0.2226)
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.151 | 0 | 9/7/2026 |
| 4.0.150 | 0 | 9/7/2026 |
| 4.0.149 | 110 | 9/6/2026 |
| 4.0.148 | 101 | 9/5/2026 |
| 4.0.147 | 85 | 9/5/2026 |
| 4.0.146 | 44 | 9/5/2026 |
| 4.0.145 | 49 | 9/5/2026 |
| 4.0.144 | 140 | 9/4/2026 |
| 4.0.143 | 64 | 9/4/2026 |
| 4.0.142 | 43 | 9/4/2026 |
| 4.0.141 | 175 | 9/4/2026 |
| 4.0.140 | 72 | 9/4/2026 |
| 4.0.137 | 81 | 9/4/2026 |
| 4.0.136 | 86 | 9/4/2026 |
| 4.0.135 | 43 | 9/4/2026 |
| 4.0.134 | 243 | 9/1/2026 |
| 4.0.133 | 105 | 8/31/2026 |
| 4.0.132 | 77 | 8/31/2026 |
| 4.0.131 | 107 | 8/31/2026 |
| 4.0.128 | 140 | 8/30/2026 |
Loading failed