HtmlSanitizer icon indicating copy to clipboard operation
HtmlSanitizer copied to clipboard

Consider replacing AngleSharp (e.g. with HAP)

Open 304NotModified opened this issue 6 years ago • 3 comments

I'am a bit sad that I have to open this issue (see also #34)

AngleSharp was promising, but:

  • It's still not stable
  • Too many breaking changes IMO,
  • Too many issues related to AngleSharp: https://github.com/mganss/HtmlSanitizer/issues?utf8=%E2%9C%93&q=is%3Aissue+AngleSharp+in%3Atitle+
  • the development of AngleSharp stalled. Even critical fixes took ages.

So, I propose to:

  • replace AngleSharp with e.g. Html Agility Pack - http://html-agility-pack.net/

    • please note they don't follow semver: https://github.com/zzzprojects/html-agility-pack/issues/74
  • and/or make the current implementation Parser independent (so we could inject parsers like HAP or AngleSharp)

Just let me know what you think.

304NotModified avatar Apr 09 '18 16:04 304NotModified

I agree, although currently there doesn't seem to be a better choice. HAP doesn't seem to have CSS support and is lacking in other areas as well, see https://github.com/AngleSharp/AngleSharp/wiki/Performance

FWIW: sanitize.rb uses Nokogumbo which in turn is based on Google's Gumbo HTML5 parser in C and crass for CSS (pure Ruby).

mganss avatar Apr 10 '18 15:04 mganss

If possible, consider at least upgrade to AngleSharp 0.9.10 https://github.com/AngleSharp/AngleSharp/releases/tag/v0.9.10.0

JiriZidek avatar Jul 23 '18 00:07 JiriZidek

@JiriZidek Done in 4.0.187.

mganss avatar Jul 23 '18 09:07 mganss

@mganss Should this be closed now?

glen-84 avatar Jan 20 '23 11:01 glen-84