Re: TIDY for PHP3

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 UTC