Package cherrypy :: Package lib :: Module tidy
[hide private]
[frames] | no frames]

Module tidy

source code

Functions to run cherrypy.response through Tidy or NSGML.

Functions [hide private]
 
tidy(temp_dir, tidy_path, strict_xml=False, errors_to_ignore=None, indent=False, wrap=False, warnings=True)
Run cherrypy.response through Tidy.
source code
 
html_space(text)
Escape text, replacing space with nbsp and tab with 4 nbsp's.
source code
 
html_break(text)
Escape text, replacing newline with HTML br element.
source code
 
wrong_content(header, body, content_type='HTML') source code
 
nsgmls(temp_dir, nsgmls_path, catalog_path, errors_to_ignore=None) source code
Function Details [hide private]

tidy(temp_dir, tidy_path, strict_xml=False, errors_to_ignore=None, indent=False, wrap=False, warnings=True)

source code 

Run cherrypy.response through Tidy.

If either 'indent' or 'wrap' are specified, then response.body will be set to the output of tidy. Otherwise, only errors (including warnings, if warnings is True) will change the body.

Note that we use the standalone Tidy tool rather than the python mxTidy module. This is because this module does not seem to be stable and it crashes on some HTML pages (which means that the server would also crash)