public WOResponse dispatchRequest(WORequest request) {
WOResponse response = super.dispatchRequest(request);
if (MDTApplication.contentTypeHTML(response)) {
ByteArrayInputStream in = response.content().stream();
ERXRefByteArrayOutputStream out = new ERXRefByteArrayOutputStream();
tidy().parseDOM(in, out);
response.setContent(out.toNSData());
}
return response;
}
Possibly exporting the formatter from WOLips to an external jar might give better results because it's designed to be very forgiving about how it interprets your HTML, but in the scheme of things, this is probably not worth the effort.
ms