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

RE: eliminate <script> tags

From: Jelks Cabaniss <jelks@jelks.nu>
Date: Wed, 23 Aug 2000 00:50:18 -0400
To: <html-tidy@w3.org>
Message-ID: <NBBBICMNIPCICMKJECCBOEEFDMAA.jelks@jelks.nu>
Vipul Veera wrote:

> Where do i modify tidy so that the program strips everything between
> <script> and </script>

Tidy doesn't do that.  You'll have to do some pre or post-processing
yourself.

It might be nice if Tidy had an option like ...

	delete-elements: marquee, blink

but it opens up a can of worms.  For example, if you say ...

	delete-elements: p

does it delete the *contents* of all the paragraphs, or just "strip the
tags"?  (In the script example, you wanted the contents removed, but that
wouldn't necessarily always be the case).  And to make it useful, you'd also
have to be able to select by attribute ...

	delete-elements: div[class="foo"], span[class="bar"]

You can see that adding this option wouldn't quite be a 15-minute hack. :)
You can get what you want today by just piping Tidy's output to an XSLT
stylesheet, a Perl script, etc.

PS.  A "transform-elements" option would be awful nice too:

	transform-elements: p[class="foo"]/p[class="bar"], ...

Would save writing an awful lot of XSLT stylesheets, scripts, etc. ...


/Jelks
Received on Wednesday, 23 August 2000 00:53:47 GMT

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