HTML-Renderer icon indicating copy to clipboard operation
HTML-Renderer copied to clipboard

Discussion: Leveraging AngleSharp

Open eXpl0it3r opened this issue 1 month ago • 2 comments

I see two general topics:

  1. Should we use third-party libraries in the Core?
  2. Should we consider AngleSharp for parsing?

Third-Part Libraries

HTML Renderer is currently very lightweight and has no dependencies. This has always been proudly presented as a feature of the library.

With .NET the "batteries included" era is changing, as certain "built-in" / .NET features are only available through NuGet packages (e.g. System.Text.Json).
Are those libraries also considered "third-party"?

If we end up having to potentially specific certain package references anyways, what's speaking against third-party dependencies?

AngleSharp

There's quite a bit of research & knowledge that went into the HTML & CSS parsers. At the time, this was certainly also quite unique.

On the other hand, the parsers are quite brittle, the implementation is not very flexible and there are still many unsupported syntax elements. Additional, the original maintainer and knowledge holder is no longer maintaining HTML Renderer and thus can't be relied upon.

Wouldn't it make sense to replace these parsers with AngleSharp?

The main thing I struggle with is, that I don't really like accidentally build monopolies, i.e. where only one implementation exists in the world.


Please provide your views and thoughts on that matter! 🙂

eXpl0it3r avatar Dec 12 '25 18:12 eXpl0it3r

You might want to enable Discussions for the repository. That way you don't need to create issues as discussions. In Discussions, you can even create polls.

As for the topic: Tough call. AngleSharp seems quite polished, full HTML-5 compliant and even handles CSS.

I'd vote for letting necessity drive the decision: One man against what's missing vs. the need of end users for said missing features. Once demand surpasses your ability to provide, switch.

webJose avatar Dec 12 '25 20:12 webJose

Thank you for the input!

I also feel like building on a solid foundation and investing more in the "rendering" side of the projects name, would be more sustainable from a maintenance perspective.

Would be interesting to hear from someone who's looked at the projects source a bit more. I just feel like the HTML & CSS parsing code isn't as valuable anymore as it used to be, but it's hard to say from the outside.

eXpl0it3r avatar Dec 15 '25 16:12 eXpl0it3r