W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 1999

Re: TIDY for PHP3

From: Dave Raggett <dsr@w3.org>
Date: Mon, 6 Sep 1999 17:13:02 +0100 (GMT Daylight Time)
To: Justin Farnsworth <jef@eyeintegrated.com>
cc: html-tidy@w3.org
Message-ID: <Pine.WNT.4.10.9909061707051.-330143@hazel.hpl.hp.com>
On Thu, 2 Sep 1999, Justin Farnsworth wrote:

> I would like to ask if anyone on this list has hacked tidy or
> generated a patch in order to use tidy with PHP3 files.
> 
> Some previous attempts such as:
> 
> 	http://techst02.technion.ac.il/~sbaruch/tidy_baruch.zip
> 
> still mangle HTML code within the PHP tags.
> 
> For those unaware of PHP3, you may visit: http://www.php.net/
> PHP is fastest-growing server-side scripting language used on the
> web, currently in 500,000 web sites according to Netcraft.
> 
> Tidy is so useful for pure HTML files that I wish to use it with
> PHP3 files also.

I tried the example given on the PHP site:

       <html><head><title>PHP Test</title></head>
       <body>
       <?php echo "Hello World<P>"; ?>
       </body></html>

It worked fine, so perhaps it's just a matter of using a recent
version of Tidy? On the other hand, perhaps Tidy still fails for
more complex examples of PHP3. One thing to note is that Tidy works
by building a clean parse tree and then pretty printing it out. This
means that if you PHP3 code generates HTML markup for the start tag
for some element, you should also include PHP3 code for the end tag,
as otherwise Tidy will be surprised by an unexpected end tag and
will delete it, most likely causing your page to fail. Tidy is only
software after all and not a mind reader.

Regards,

-- Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett
phone: +44 122 578 2984 (or 2521) +44 385 320 444 (gsm mobile)
World Wide Web Consortium (on assignment from HP Labs)
Received on Monday, 6 September 1999 12:11:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:42 GMT