-
Notifications
You must be signed in to change notification settings - Fork 394
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
WICKET-7036: MarkupFactory supports IMarkupFilters #564
base: wicket-9.x
Are you sure you want to change the base?
Conversation
@@ -61,6 +64,8 @@ public static MarkupFactory get() | |||
return Application.get().getMarkupSettings().getMarkupFactory(); | |||
} | |||
|
|||
private final LinkedHashMap<IMarkupFilter, Class<? extends IMarkupFilter>> additionalMarkupFilters = new LinkedHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it would be better to change private final LinkedHashMap
-> private final Map
Is this really necessary? The Javadoc for * MarkupParser's can be extended by means of {@link IMarkupFilter}. You can add your own filter
* as follows:
*
* <pre>
* public MyMarkupFactory {
* ...
* public MarkupParser newMarkupParser(final MarkupResourceStream resource) {
* MarkupParser parser = super.newMarkupParser(resource);
* parser.add(new MyFilter());
* return parser;
* }
* }
* </pre> |
I agree with @theigl that one could easily extend MarkupFactory and achieve the requirement. |
I agree with you, that one could easily extend MarkupFactory and achieve the requirement. That's in fact, what we do now. I just want to explain, why it would be helpful to have such an extension: |
Thanks for the explanation, @hosea ! I can see how the code in this PR would help for your case! How about adding these new methods to |
Wicket-7036: Support IMarkupFilters within MarkupFactory.