mganss / HtmlSanitizer

Cleans HTML to avoid XSS attacks
MIT License
1.56k stars 200 forks source link

Conflict Between HtmlSanitizer and Bunit Due to AngleSharp Version #558

Closed HarshitDubey-Raik closed 2 months ago

HarshitDubey-Raik commented 2 months ago

I am encountering a version conflict while writing unit tests using Xunit in C#. I have a project named Test which references another project named Worker. The Worker project includes HtmlSanitizer. In the Test project, I need to install Bunit, which requires AngleSharp version >= 1.1.2.

This version mismatch is causing conflicts, and I am unable to resolve this dependency issue.

Following is the error being displayed while installing

Version conflict detected for AngleSharp. 
Install/reference AngleSharp 1.1.2 directly to project Tests to resolve this issue. 
Tests -> bunit 1.30.3 -> bunit.web 1.30.3 -> AngleSharp (>= 1.1.2) 
Tests -> Worker -> HtmlSanitizer 8.0.865 -> AngleSharp (= 0.17.1).

Any insights or suggestions on resolving this dependency conflict would be greatly appreciated. Thank you!

mganss commented 2 months ago

Try the latest prerelease version of HtmlSanitizer. It's compatible with AngleSharp 1.1.2. See also #491

HarshitDubey-Raik commented 2 months ago

@mganss Actually the application using the HtmlSanitizer is in production, so cannot use this pre-release beta version, if you can please confirm till when can we except the proper release for the same ?

tiesont commented 2 months ago

@HarshitDubey-Raik AngleSharp.Css is the hold-up, last I was aware - waiting on a 1.0.0 release, so that there can be a fair amount of confidence that the API won't change significantly (which has been a bit of a problem with AngleSharp in the past, as noted in the linked issue).

tiesont commented 1 month ago

Worth noting? https://github.com/AngleSharp/AngleSharp.Css/issues/175#issuecomment-2271327388

Right now there are no sponsors, so the project is on hold. There is no timeline for releasing the 1.0.0 of AngleSharp.Css.