CodeBrix.MarkupParse.MitLicenseForever
1.0.238.561
dotnet add package CodeBrix.MarkupParse.MitLicenseForever --version 1.0.238.561
NuGet\Install-Package CodeBrix.MarkupParse.MitLicenseForever -Version 1.0.238.561
<PackageReference Include="CodeBrix.MarkupParse.MitLicenseForever" Version="1.0.238.561" />
<PackageVersion Include="CodeBrix.MarkupParse.MitLicenseForever" Version="1.0.238.561" />
<PackageReference Include="CodeBrix.MarkupParse.MitLicenseForever" />
paket add CodeBrix.MarkupParse.MitLicenseForever --version 1.0.238.561
#r "nuget: CodeBrix.MarkupParse.MitLicenseForever, 1.0.238.561"
#:package CodeBrix.MarkupParse.MitLicenseForever@1.0.238.561
#addin nuget:?package=CodeBrix.MarkupParse.MitLicenseForever&version=1.0.238.561
#tool nuget:?package=CodeBrix.MarkupParse.MitLicenseForever&version=1.0.238.561
CodeBrix.MarkupParse
A fully managed, cross-platform HTML/markup parsing library for .NET.
CodeBrix.MarkupParse has no dependencies other than .NET, and is provided as a .NET 10 library and associated CodeBrix.MarkupParse.MitLicenseForever NuGet package.
CodeBrix.MarkupParse supports applications and assemblies that target Microsoft .NET version 10.0 and later. Microsoft .NET version 10.0 is a Long-Term Supported (LTS) version of .NET, and was released on Nov 11, 2025; and will be actively supported by Microsoft until Nov 14, 2028. Please update your C#/.NET code and projects to the latest LTS version of Microsoft .NET.
CodeBrix.MarkupParse is a fork of the code of the open source AngleSharp library - see below for licensing details.
Installation
dotnet add package CodeBrix.MarkupParse.MitLicenseForever
Note that the NuGet package ID and the namespace are different - there is no package named plain CodeBrix.MarkupParse:
- NuGet package ID:
CodeBrix.MarkupParse.MitLicenseForever - Assembly and root namespace:
CodeBrix.MarkupParse
The type you start from, HtmlParser, lives in CodeBrix.MarkupParse.Html.Parser; Configuration and BrowsingContext, used for loading documents over HTTP, live in the root CodeBrix.MarkupParse namespace. The package has no NuGet dependencies and no native libraries, and runs anywhere .NET 10 runs. XML documentation (IntelliSense) ships alongside the assembly.
CodeBrix.MarkupParse supports:
- HTML parsing and DOM construction
- CSS selector queries (
QuerySelector,QuerySelectorAll) - Document manipulation (create, append, remove elements)
- HTML serialization (
OuterHtml,InnerHtml,TextContent) - Markup formatting (standard, pretty-print, minified, XHTML)
- Fragment parsing
- Source position tracking
- Asynchronous document loading and parsing
- SVG and MathML element support
- Form handling and validation
- Many more...
CodeBrix.MarkupParse parses and manipulates HTML; it does not render, style or execute it. There is no layout or box model, no getComputedStyle, and <script> content is treated as text and never run. It parses CSS selectors for querying but does not parse or evaluate CSS stylesheets - the sibling CodeBrix.StyleSheetParse.MitLicenseForever package covers that. It is also not an XML parser, not a general-purpose HTTP client, and - importantly - not an HTML sanitizer: there is no allow-list scrubber, so parsing untrusted markup and re-serializing it is not a security boundary.
Sample Code
Parse an HTML String
using CodeBrix.MarkupParse.Html.Parser;
var parser = new HtmlParser();
var document = parser.ParseDocument("<h1>Hello World</h1><p>This is a paragraph element");
Console.WriteLine(document.DocumentElement.OuterHtml);
Query Elements with CSS Selectors
using CodeBrix.MarkupParse.Html.Parser;
using System.Linq;
var parser = new HtmlParser();
var document = parser.ParseDocument(
"<ul><li>First item<li>Second item<li class='blue'>Third item!<li class='blue red'>Last item!</ul>");
// Use CSS selectors to find elements
var blueItems = document.QuerySelectorAll("li.blue");
var titles = blueItems.Select(m => m.TextContent);
Manipulate the DOM
using CodeBrix.MarkupParse.Html.Parser;
var parser = new HtmlParser();
var document = parser.ParseDocument("<h1>Some example source</h1><p>This is a paragraph element");
var p = document.CreateElement("p");
p.TextContent = "This is another paragraph.";
document.Body.AppendChild(p);
Console.WriteLine(document.DocumentElement.OuterHtml);
Track Source Positions
using CodeBrix.MarkupParse.Html.Parser;
var parser = new HtmlParser(new HtmlParserOptions
{
IsKeepingSourceReferences = true,
});
var document = parser.ParseDocument("<!doctype html><body>");
var bodyPos = document.Body.SourceReference.Position;
// bodyPos == TextPosition(Line: 1, Column: 16, Position: 16)
Load a Document from a URL
using CodeBrix.MarkupParse;
using System.Linq;
var config = Configuration.Default.WithDefaultLoader();
var address = "https://en.wikipedia.org/wiki/List_of_The_Big_Bang_Theory_episodes";
var document = await BrowsingContext.New(config).OpenAsync(address);
var cells = document.QuerySelectorAll("tr.vevent td:nth-child(3)");
var titles = cells.Select(m => m.TextContent);
Documentation
The NuGet package includes AGENT-README.txt, a complete API reference and usage guide written for AI coding agents - point your agent at that file when it is writing code against this library.
Additional sample code and usage examples are available in the CodeBrix.MarkupParse.Tests project:
https://github.com/ellisnet/CodeBrix.MarkupParse/tree/main/tests/CodeBrix.MarkupParse.Tests
License
The project is licensed under the MIT License. see: https://en.wikipedia.org/wiki/MIT_License
All code originating from AngleSharp was included as allowed by the MIT License permissible open source software license - as of AngleSharp version 7.1.0. This project (CodeBrix.MarkupParse) complies with all provisions of the source code license of AngleSharp v7.1.0 (MIT License).
| 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. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CodeBrix.MarkupParse.MitLicenseForever:
| Package | Downloads |
|---|---|
|
CodeBrix.PdfDocCreate.Html2Pdf.MitLicenseForever
Renders author-created HTML pages with CSS styling into PDF documents via the CodeBrix.PdfDocCreate document object model. Applies a documented subset of CSS - inline style attributes, style blocks, and linked local stylesheets - with real selector matching, cascade, specificity, and inheritance. Embeds every image format CodeBrix.Imaging decodes plus SVG (referenced files, data: URIs, and inline svg elements, placed as PDF vector content by default, or rasterized on request - identically on Windows, macOS, and Linux, with no native dependency). All text is rendered with the CodeBrix.Platform.Fonts Roboto (sans-serif), Merriweather (serif), and Roboto Mono (monospace) font packages - plus the Noto companion families they bundle, which extend coverage to polytonic (ancient) Greek, Armenian, Georgian and music notation, and any fonts the consumer registers - so output is identical on every operating system. Designed for HTML/CSS written for PDF generation, not for repurposing arbitrary web pages. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.238.561 | 100 | 8/26/2026 |
| 1.0.164.1248 | 225 | 6/13/2026 |
| 1.0.117 | 131 | 4/29/2026 |
| 1.0.100 | 122 | 4/11/2026 |