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

Update AngleSharp to 0.10.0 #154

Closed
NikolayIT opened this issue Jan 6, 2019 · 23 comments
Closed

Update AngleSharp to 0.10.0 #154

NikolayIT opened this issue Jan 6, 2019 · 23 comments

Comments

@NikolayIT
Copy link

NikolayIT commented Jan 6, 2019

https://github.com/AngleSharp/AngleSharp/releases/tag/v0.10.0

Please keep in mind that the old .NET 4 and Silverlight targets are dropped. AngleSharp now targets .NET Standard 2.0.

Also you might need to install AngleSharp.Css package.

Migration guide: https://github.com/AngleSharp/AngleSharp/blob/master/doc/Migration.md

@mganss
Copy link
Owner

mganss commented Jan 7, 2019

I've merged master into the AngleSharp_0_10 branch. It compiles but a large number of unit tests fail. AngleSharp.Css does some surprising "normalization" of CSS values, e.g.

<div style="color: black; background-color: white">Test</div>

becomes

<div style="color: rgba(0, 0, 0, 1); background: rgba(255, 255, 255, 1)">Test</div>

At first glance this behavior seems to contradict what browsers are doing. I'll try to dig deeper and perhaps open issues at AngleSharp.Css.

See also #117. I'll close that issue so discussion can continue here.

@stweb
Copy link

stweb commented Jan 7, 2019

Hmm, I need .Net Standard compatibility which comes with AngleSharp 0.10.0 - could you provide a beta version which targets it? The we can see if the CSS changes are causing issues. Otherwise I need to use a custom build version ... Thanks.

@mganss
Copy link
Owner

mganss commented Jan 7, 2019

@stweb HtmlSanitizer today targets netstandard1.3 and netstandard2.0 (in addition to net40 and net45). After the update to AngleSharp 0.10 it will only target netstandard2.0 and net46.

@NikolayIT
Copy link
Author

NikolayIT commented Jan 8, 2019

Can you please publish some preview in NuGet? :)

Also version 0.10.1 is available for AngleSharp having .NET Standard 1.3 target.

@mganss
Copy link
Owner

mganss commented Jan 8, 2019

@NikolayIT AngleSharp.Css does not (yet?) support netstandard1.3. I will have to wait for a few issues in AngleSharp.Css to be resolved, in particular AngleSharp/AngleSharp.Css#14. What prevents you from using the current stable HtmlSanitizer?

@NikolayIT
Copy link
Author

I don't have problems using the latest stable HtmlSanitizer. I just want to use the new version of AngleSharp and I need both HtmlSanitizer and AngleSharp in my solution :)

@304NotModified
Copy link
Contributor

AngleSharp.Css does some surprising "normalization" of CSS values

That's bad :(

@tiesont
Copy link

tiesont commented Jan 10, 2019

AngleSharp.Css does some surprising "normalization" of CSS values

That's bad :(

@304NotModified Agreed. If I have background: #fff as a style on some element, I expect that to be unchanged.

@mesutcakir
Copy link

image

System.TypeLoadException: 'AngleSharp.Parser.Html.HtmlParser' türü 'AngleSharp, Version=0.11.0.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea'

@rogerfar
Copy link

@mesutcakir unfortunately you can't run HtmlSanitizer and have AngleSharp installed. I ran in the same issue today.

@304NotModified
Copy link
Contributor

unfortunately you can't run HtmlSanitizer and have AngleSharp installed

Yes you can, but you can't mix versions. That's because anglesharp makes breaking changes. (Unfortunately allowed with Semver because it's not 1.0 yet)

@NikolayIT
Copy link
Author

@mganss, Any updates on this? :-)

@mganss
Copy link
Owner

mganss commented Mar 28, 2019

There has been no progress at AngleSharp.Css (still at 0.10.0). I will look into this again once a new version of AngleSharp.Css has been released that fixes AngleSharp/AngleSharp.Css#14.

@mganss
Copy link
Owner

mganss commented May 15, 2019

AngleSharp.Css 0.12.1 has been released which fixes AngleSharp/AngleSharp.Css#14. It doesn't fix AngleSharp/AngleSharp.Css#9, however, and it seems this won't been fixed in future releases, either. The latter issue is the one where color: black (and all other color representations such as #000) get normalized to rgba(0, 0, 0, 1). This also has an upside, though: You can always expect the same representation when matching CSS values in DisallowCssPropertyValue.

I've released 5.0.125-beta with dependencies on AngleSharp, AngleSharp.Css 0.12.1.

@304NotModified
Copy link
Contributor

Any Idea if this is possible ? From
AngleSharp/AngleSharp.Css#9

Remark: Actually, also AngleSharp today is performing this kind of normalization, but it can be turned off via a simple flag. In AngleSharp.Css this is much more flexible and you just insert a different interface to handle it.

@mganss
Copy link
Owner

mganss commented May 15, 2019

I think it's the same as "Write your own value creator" in that same comment (AngleSharp/AngleSharp.Css#9 (comment)). I asked specifically about this in AngleSharp/AngleSharp.Css#9 (comment) but didn't get a response.

@NikolayIT
Copy link
Author

Updating both AngleSharp to latest stable and HtmlSanitizer to latest preview is working as expected.

Thanks!

@jerone
Copy link

jerone commented Jun 25, 2019

Please update AngleSharp to the latest and implement something like this to get notified about package updates.

@mganss
Copy link
Owner

mganss commented Jun 25, 2019

@jerone The latest beta 5.0.218-beta uses the latest AngleSharp version (0.12.1). I've been wanting to try dependabot, it's only been free for a couple of weeks now that they've been acquired by GitHub.

@304NotModified
Copy link
Contributor

304NotModified commented Jun 25, 2019

Im using dependabot for weeks, works great! (But only with sdk style csprojs)

Very easy to setup also :)

Update. Ah I see you've set it up already 👍

@mganss
Copy link
Owner

mganss commented Jun 27, 2019

@304NotModified Yeah, very nice. It also automatically rebases PRs and automatically closes them if they're no longer needed. I enabled it for a good handful of projects at once and immediately got a ton of e-mails 🙄

@Doidel
Copy link

Doidel commented Oct 24, 2019

I'm also using AngleSharp alongside HtmlSanitizer. Thanks for those beta versions, saved my life! phew

@mganss
Copy link
Owner

mganss commented Feb 29, 2020

Has been released in 5.0.298

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

9 participants