RE: PHP support

I think what Tidy _can_ do for you is convert the HTML to XHTML and you can
pick up the code fragments with XSLT and, from there, feed them into a
JavaScript/VBScript pretty printer.  But the cure might be worse than the
disease...

take it easy,
Charlie

-----Original Message-----
From: Klaus Johannes Rusch [mailto:KlausRusch@atmedia.net]
Sent: Friday, November 02, 2001 5:29 PM
To: html-tidy@w3.org
Subject: Re: PHP support


In <3BE2E176.5663BE3B@caldera.com>, Allan Clark <allanc@caldera.com> writes:

Allan,

> Now, I know this isn't the best way, I'd love a better way, but how can
> we reliably pick up these code fragments and intelligently re-format the
> output?

thanks exactly my point, it cannot be done.

Macro functions as you suggest could help resolve quoting issues but cannot
fix
something like

 <script type="application/javascript" language="Javascript1.2">
 var referer=document.referer; document.write("<"); if (referer)
 {document.write("IMG SRC=some.gif>");} else document.write("SPAN 
 color=red>Invalid source");}; document.writeln("</SPAN>");
 </script>

Code like this is very popular with ad networks to circumvent ad filtering
software, so tidy will almost certainly see something like this on many
pages.

Fixing this code would require understanding, and in similar cases even 
modifying the program logic, which for general program code would be
equivalent to solving the Halting Problem.

-- 
Klaus Johannes Rusch
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/

Received on Friday, 2 November 2001 18:29:15 UTC