Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare with HtmlSanitizer package #26

Open
MNF opened this issue May 3, 2021 · 2 comments
Open

Compare with HtmlSanitizer package #26

MNF opened this issue May 3, 2021 · 2 comments

Comments

@MNF
Copy link

MNF commented May 3, 2021

Can you provide in ReadMe Comparison with HtmlSanitizer package https://github.com/mganss/HtmlSanitizer?
It’s hard to choose one, and description when one or another is more suitable will be useful.

@runekock
Copy link

HtmlSanitizer seems to be a more powerful and more complex solution.

For my purpose, I needed to change the code a bit, and then HtmlRuleSanitizer (and the underlying Html Agility Pack) proved much easier than HtmlSanitizer (based on the very challenging AngleSharp).

However, if you just need to use the code as-is, and don't care about the underlying complexity, then HtmlSanitizer may be the better choice.

Just my opinion as a user.

@cakkermans
Copy link
Contributor

The primary difference with HtmlSanitizer is indeed the HTML parser being used in the background. The Html Agility Pack was not really maintained for some time in history, but is again maintained actively for the past years. HtmlSanitizer uses the AngleSharp package to parse HTML, which I read to be more strict (and thus less easy to work with low quality HTML code), but I have no personal experience with it.

In addition HtmlSanitizer allows for extensive CSS sanitization, which HtmlRuleSanitizer does not do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants