[Zope] Patch to check all pages with html-tidy

Oliver Bleutgen myzope@gmx.net
Wed, 09 Apr 2003 12:57:23 +0200


Thomas Guettler wrote:
> On Wed, Apr 09, 2003 at 11:33:15AM +0100, Andy McKay wrote:
> 
>>Im not sure I'd want to do this for every request, but maybe we could 
>>something like this to ZChecker, which finds bugs and issues in ZPT, 
>>DTML etc, including running ZPT through htmltidy?
> 
> 
> This patch is of course only usefull for developing with zope. Since
> it checks in HTTPResponse.py it only can access html and not ZPT or DTML.
> 
> I found no way to access the requested URL of the HTTPResponse. If
> this would be possible, you could only check the pages which match a
> regular expression.

I'm not quite sure if this really is right, but since I am looking at 
CookieCrumbler at the moment I thought I'd mention that.

CookieCrumbler modifies the response by substituting the unauthorized 
method, you alter the response by patching in a html_tidy() method.
Maybe you can take a look at what CookieCrumbler does and do what you 
are doing as a product instead of a patch.
Should be quite easy and has the benefit of being a product _and_ giving 
you access to any data which is available inside normal zope (including 
the requested URL).
In the simplest case, one could just drop an instance of the imaginary 
ZHtmlTidy product into a folder to get anything below that folder checked.


cheers,
oliver