Tidy is included with every PHP5 installation, but it has be manually activated in php.ini. Value == 1 means tidy only partial templates (with no <html> or <body> tags) This is supposed to work quite well. Value == 2 means tidy all, including files with <head>, and this can fail, if You have <?php tags inside <head> with nested <script> tags.
Tags:
todo:
tidy removes empty tags (shouldnt !!!!)
TODO:
create formatter API
todo:
Strip out HTML/BODY if it's soudlnt be in the template (something what show-body-only should do).
If You want to use self::$fixWebRoot You have to pass phpQuery object directly. CAUTION: this method will call unload() on passed phpQuery object, so You cant use it futher. Use $unloadDocument to avoid this.