THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Note: a markup filter is not able to detect an AttributeModifier changing the src attribute to an empty string.
Wicket 1.4:
Code Block |
---|
public class MyApplication extends Application
{
protected void init()
{
...
getMarkupSettings().setMarkupParserFactory(
new MyMarkupParserFactory());
...
}
}
public class MyMarkupParserFactory implements IMarkupParserFactory {
@Override
public MarkupParser newMarkupParser(MarkupResourceStream resource) {
MarkupParser parser = new MarkupParser(new XmlPullParser(), resource);
parser.appendMarkupFilter(new MyMarkupFilter());
return parser;
}
}
|
It's maybe a good idea to allow your MarkupParserFactory accept a list of filters which might get appended on creation of the parser in 'newMarkupParser'.
Wicket 1.2:
Code Block |
---|
public class MyApplication extends Application { protected void init() { IMarkupFilter filter = new HtmlProblemFinder(HtmlProblemFinder.ERR_THROW_EXCEPTION); getMarkupSettings().setMarkupParserFactory(new MarkupParserFactory(this, filter)); } } |
...