Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

AngleSharp – a standards‑compliant HTML parser for .NET

Описание и применение

AngleSharp – это библиотека .NET, реализующая спецификацию DOM и позволяющая парсить HTML, SVG, MathML, CSS и XML без использования браузера. Проект вырос из личного эксперимента в широко используемый компонент с более чем 500 млн установок, применяемый в sanitization, тестировании и рендеринге.

Задача

Developers needed a reliable, spec‑conformant HTML/CSS/JS parser in C# that could be used for scraping, testing, rendering, and sanitization without writing regexes.

Результат

AngleSharp grew from a side project into a widely adopted .NET foundation project with over 500 million installs, powering sanitization, testing, email rendering, and many commercial applications.

Рабочий процесс

  • 1. Implement a pure C# HTML5 parser from the spec.
  • 2. Add CSS engine and optional JavaScript engine via modular extensions.
  • 3. Expose a BrowsingContext API that mimics a browser tab.
  • 4. Publish as NuGet packages and open‑source on GitHub.
  • 5. Engage community for bug fixes, API improvements, and feature requests.
  • 6. Integrate into downstream projects (HtmlSanitizer, bUnit, PreMailer.Net, etc.).

Доказательства

AngleSharp is a .NET library that parses HTML, SVG, MathML, CSS, and (to a good extent) XML, and gives you back a fully-featured, spec-conformant DOM.

Источник

The repository already had 120+ stars, and the article was ranking surprisingly well.

Источник

AngleSharp 0.10 laid the groundwork for modularity, allowing extensions like CSS and JS to be added as separate libraries.

Источник

The core NuGet package alone sits at over 310 million downloads.

Источник

HtmlSanitizer uses AngleSharp to parse and re‑render HTML while stripping out anything that could be used for cross‑site scripting.

Источник

  • Дата записи: 2026-10-02T12:41:07.292Z