-
Notifications
You must be signed in to change notification settings - Fork 92
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
!important CSS rule is removed #81
Comments
Thanks for raising this issue. @spassarop - can you confirm the problem (with the provided test case), and see if you can come up with a fix? |
I can confirm. The if (!isInline) { styleSheet.append('\t'); }
styleSheet.append(name);
styleSheet.append(':');
// append all values
while (value != null) {
styleSheet.append(' ');
styleSheet.append(validator.lexicalValueToString(value));
value = value.getNextLexicalUnit();
}
styleSheet.append(';');
if (!isInline) { styleSheet.append('\n'); } I guess we could just add |
OK. Can you add a test case with and without !important, so we can verify this change only includes it when it is specified, and doesn't add it when it is not specified? |
Yes. I’ll do that now.
…On Tue, 6 Apr 2021 at 19:17 Dave Wichers ***@***.***> wrote:
OK. Can you add a test case with and without !important, so we can verify
this change only includes it when it is specified, and doesn't add it when
it is not specified?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#81 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHL3BMORNKSCVDWUWVQD6PDTHOCBBANCNFSM42O5HYCQ>
.
|
@spassarop - Thanks for jumping on this so quick! @mrpeny - We have implemented a quick fix in the 1.6.3 branch. Can you test the fix out to verify it fixes the problem as you'd expect. I want to make sure that the !important added back in is in exactly the right place and works as you expect. |
@davewichers I have checked the implementation in the PR and it looks good to me. I have also included When do you plan to release |
@mrpeny - Thanks for reviewing. I'd like to get the release out tonight. I just have to update some JavaDocs related to the other fix going out with 1.6.3. Then it should be ready to ship. |
Thank you. |
Fixed in release 1.6.3 that just went out. |
@davewichers when is it expected to appear on Maven Central? |
It's already there I believe. |
It's there now. Thank you. Have a nice weekend! |
We started to use AntiSamy for CSS validation in our WEB project and realized that it removes
!important
CSS rules from the styles.Eg.
<p style=\"color: red !important\">Some Text</p>
resolves to<p style=\"color: red\">Some Text</p>
The following test added to
AntiSamyTest
fails.I see it from the method parameters of
org.owasp.validator.css.CssHandler#property
that we are aware of the fact if a property is important or not but it looks like the code ignores this information as the argument is not used anywhere.Is there a way to get it working or am I missing something? Let me know if you need further information!
Thank you in advance!
The text was updated successfully, but these errors were encountered: