-
Notifications
You must be signed in to change notification settings - Fork 93
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
IllegalStateException on rgb percentage values #546
Comments
… percentage rgb values
This issue seems to exist for some time now. It is mentioned here: |
@spassarop - This is the issue that the pull request is trying to address. |
@jonah1und1 Thanks for your proposed fix. I agree it can be tackled the way you did, however, I added some comments that will improve the solution and also match the kind of behavior we expect when creating a fix for AntiSamy outputs. |
@spassarop Thank you for your answer and review. Unfortunately, I was not able to find your comments. Could you please point me to them? |
…f converting them to int
This issue has been fixed in main. Will go out in next release. |
Antisamy seems to have an issue with parsing rgb percentage values such as
rgb(50%, 50%, 50%)
.Expected bahaviour
Percentage colour values should be parsed just like integer values between 0 and 255. Scanning the following style tag should not yield any errors:
Current behaviour
Scanning aforementioned style tag results in antisamy throwing an
IllegalStateException
.I've created an example project with a corresponding test:
https://github.com/jonah1und1/antisamy-rgb-percentage .
Possible fixes
I assume the problem could be mitigated by explicitly handling percentages for rgb colours in
CssValidator.java:343
.I have created a pull request with a possible fix: #547.
Please feel free to review.
The text was updated successfully, but these errors were encountered: