-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Safelist - make is* methods public? #1780
Comments
The public methods are added instead of modified, #isSafeTag() to be #testSafeTag(), #isSafeAttribute() to be #testSafeAttribute(), #getEnforcedAttributes() to be #enforcedAttributes() |
Brilliant! Thanks a lot. |
Wouldn't it be better to make the methods only BTW, would @snak3b1te, I would be interested to know what your implementation of |
@jhy my interest was to create a custom cleaner. The cleaner needs access to the |
@jhy wanted to check back on the status of this request (as of version 1.16.1). With the Another thing that bugs me: All methods to create or modify So, while my use case might be rather specific, it would allow re-use of the |
Thanks for the feedback - have made those three public. |
I had the problem to verify complete HTML documents and provide detailed reporting on offending tags. No problem - just write a new
Cleaner
implementation with the changed behavior I thought. Well, not so much:Safelist
cannot be used in that scenario because all test methods like#isSafeTag()
and friends (#isSafeAttribute()
,#getEnforcedAttributes()
) areprotected
ordefault
.Cleaner
can access them of course, being in the same package.With the Java-9+ module system however, I cannot just create my own class in that same package as it belongs to a different module.
So, I have to write my own
Safelist
, too. (Or copy the source to some local package.) Which is kind of sad.Could we make those test methods
public
so thatSafelist
could be used in custom code?The text was updated successfully, but these errors were encountered: