Mark Dyer wrote:

> The function is to remove all html comments from in a page but ignore any
> style or script blocks.

Mark-

Using the

<script>
//<--
foo
//-->
</script>

method of commenting is outdated and really no longer applies.  If your 
user is still on IE3, let them see the code, in hopes that they will 
upgrade their browser.


<script>
<![CDATA[
foo
]]>
</script>

is the way it should be done at this point, especially if you are using 
an xhtml doctype.

same goes for CSS blocks:


<style type="text/css">
<!--/*--><![CDATA[/*><!--*/

CSS goes in here

/*]]>*/-->
</style>

if serve the XHTML as application/xhtml+xml

if you serve the xhtml as text/html,
<style type="text/css">
<![CDATA[

CSS goes in here

]]>
</script>

will suffice.



This is somethign to consider before you go through the hassel of the regex.

Of which, i can offer no guidance on, as I can never get those things to 
work either :p




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/2jUsvC/tzNLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to