HtmlSanitizer
HtmlSanitizer copied to clipboard
Consider replacing AngleSharp (e.g. with HAP)
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.
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).
If possible, consider at least upgrade to AngleSharp 0.9.10 https://github.com/AngleSharp/AngleSharp/releases/tag/v0.9.10.0
@JiriZidek Done in 4.0.187.
@mganss Should this be closed now?