-
Notifications
You must be signed in to change notification settings - Fork 200
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
CSS (shorthand) properties getting removed #178
Comments
AngleSharp.Css expands shorthand properties into longhands since 0.10 (see AngleSharp/AngleSharp.Css#9). I guess we'll have to add all the longhand property names to the default list of allowed properties. |
I've added the longhands for which we had shorthands already in the configuration and will update docs accordingly. |
Happy holidays @mganss Could you please push the latest version (v5.0.287) to NuGet? It has this issue's fix that I want. A bunch of my style tags are gone when sanitizing 😶rendering the output HTML undesirable. If you can't push to NuGet, do you recommend any other alternatives? Should I build HtmlSanitizer myself and including it as a DLL? |
Happy holidays @om-ha This is included in 5.0.274-beta. |
Hello,
just stumbled over this, not sure if it's a known issue/wanted behaviour but when sanitizing the following fragment with default settings the style tag gets removed completely:
new HtmlSanitizer().Sanitize("<p><span style=\"text-decoration: underline;\">bla</span></p>");
When iterating the styles it checks for text-decoration-style, text-decoration-color and text-decoration-line instead of text-decoration (the actual CssText) which is included in AllowedCssProperties while the former ones are not.
Found on current master and 5.0.218-beta package.
My apologies if this is intended I just find it odd because the text-decoration property is included in the default allowed css properties.
The text was updated successfully, but these errors were encountered: