php + html tidying

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

php + html tidying

Ken van Mulder

Hey folks,

I'm trying to find a command line program that will auto-indent a file
with mixed html/php and point out some of the flaws in the html.

Here are some of the problems I'm running into:

Tidy insists on adding a doctype and <html><head>, etc. tags to a file
but I use php commands to include headers that contain these. The option
"show-body-only: yes" strips out all of my php tags.

Tidy will also change the indentation of <?php ?> tags.

Is it possible to run tidy in such a way that it will not add any tags
that are not existing, clean up the html and leave the indentation of
anything with <?php ?> alone? I have another script that does a nice
enough job of the php code, but butchers the indentation of the html.

Any advise or help is much appreciated!

--
Ken van Mulder
Wavefire Technologies Corporation

http://www.wavefire.com
250.717.0200 (ext 113)